Browse Source

protocol: rename remaining into available

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

2
protocol/src/master.rs

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

Loading…
Cancel
Save