Browse Source

protocol: rename remaining into available

master
Denis Drakhnia 2 months ago
parent
commit
dfb702f58d
  1. 4
      protocol/src/cursor.rs
  2. 2
      protocol/src/master.rs

4
protocol/src/cursor.rs

@ -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)

2
protocol/src/master.rs

@ -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;

Loading…
Cancel
Save