protocol: rename remaining into available

This commit is contained in:
Denis Drakhnia 2024-09-26 08:23:55 +03:00
parent df3e1b23be
commit dfb702f58d
2 changed files with 3 additions and 3 deletions

View File

@ -405,7 +405,7 @@ impl<'a> CursorMut<'a> {
} }
#[inline(always)] #[inline(always)]
pub fn remaining(&self) -> usize { pub fn available(&self) -> usize {
self.buffer.len() - self.pos self.buffer.len() - self.pos
} }
@ -413,7 +413,7 @@ impl<'a> CursorMut<'a> {
where where
F: FnMut(&mut [u8]), F: FnMut(&mut [u8]),
{ {
if count <= self.remaining() { if count <= self.available() {
f(&mut self.buffer[self.pos..self.pos + count]); f(&mut self.buffer[self.pos..self.pos + count]);
self.pos += count; self.pos += count;
Ok(self) Ok(self)

View File

@ -180,7 +180,7 @@ impl QueryServersResponse<()> {
} }
let mut count = 0; let mut count = 0;
let mut iter = list.iter(); let mut iter = list.iter();
while cur.remaining() >= A::size() * 2 { while cur.available() >= A::size() * 2 {
if let Some(i) = iter.next() { if let Some(i) = iter.next() {
i.put(&mut cur)?; i.put(&mut cur)?;
count += 1; count += 1;