lib/reader: fmt
This commit is contained in:
parent
95e1edd194
commit
2e3562c28e
|
@ -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),
|
||||||
|
|
Loading…
Reference in a new issue