lib/reader: fmt

This commit is contained in:
Paul Stemmet 2021-06-03 16:24:45 +00:00 committed by Paul Stemmet
parent 95e1edd194
commit 2e3562c28e

View file

@ -49,8 +49,9 @@ where
/// Attempt to reserve up to amt chars, returning the actual number added /// Attempt to reserve up to amt chars, returning the actual number added
pub fn reserve(&mut self, amt: usize) -> Result<usize> { pub fn reserve(&mut self, amt: usize) -> Result<usize> {
let mut done = 1; let mut done = 0;
while done <= amt {
while done < amt {
match self.src.next() { match self.src.next() {
Some(Ok(c)) => self.buffer.push_front(c), Some(Ok(c)) => self.buffer.push_front(c),
Some(Err(e)) => return Err(e), Some(Err(e)) => return Err(e),