Re: [PATCH v2] rust: add a ring buffer implementation

From: Andreas Hindborg

Date: Mon Jun 08 2026 - 03:29:29 EST


Onur Özkan <work@xxxxxxxxxxxxx> writes:

> On Fri, 05 Jun 2026 15:10:30 +0200
> Andreas Hindborg <a.hindborg@xxxxxxxxxx> wrote:
>

<cut>

>> +
>> +use super::{
>> + allocator::{KVmalloc, Kmalloc, Vmalloc},
>> + Allocator, Flags, Vec,
>> +};
>
> nit: Vertical style import missing.
>

<cut>

>> + /// Returns `true` if the buffer is full.
>> + ///
>> + /// When the buffer is full, any call to [`push_head`] will return an error.
>> + ///
>> + /// [`push_head`]: Self::push_head
>> + pub fn full(&self) -> bool {
>> + (self.head + 1) % self.nodes.len() == self.tail
>
> Nit: This seems short enough to inline.
>

Thanks, I'll be sure to fix these for next spin.


Best regards,
Andreas Hindborg