aboutsummaryrefslogtreecommitdiff
path: root/src/util/buffer_queue.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/buffer_queue.rs')
-rw-r--r--src/util/buffer_queue.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/util/buffer_queue.rs b/src/util/buffer_queue.rs
index 5201a57..b741b36 100644
--- a/src/util/buffer_queue.rs
+++ b/src/util/buffer_queue.rs
@@ -66,7 +66,7 @@ impl BufferQueue {
#[inline]
pub fn pop_front(&mut self) -> Option<String> {
if let Some((i, s)) = self.buffers.pop_front() {
- return Some(s[i..].into())
+ return Some(s[i..].into());
}
None
// self.buffers.pop_front().map(|(i, s)| &s[i..])
@@ -101,7 +101,9 @@ impl BufferQueue {
.is_none(),
"invariant \"all buffers in the queue are non-empty\" failed"
);
- self.buffers.front().map(|(i, s)| s[*i..].chars().next().unwrap())
+ self.buffers
+ .front()
+ .map(|(i, s)| s[*i..].chars().next().unwrap())
}
/// Get the next character if one is available, removing it from the queue.
@@ -114,7 +116,7 @@ impl BufferQueue {
let c = &buf[*i..].chars().next().expect("empty buffer in queue");
*i += c.len_utf8();
(Some(*c), buf[*i..].is_empty())
- },
+ }
};
if now_empty {
@@ -139,7 +141,7 @@ impl BufferQueue {
*i += c.len_utf8();
(Some(FromSet(*c)), buf[*i..].is_empty())
}
- },
+ }
};
// Unborrow self for this part.
@@ -188,7 +190,7 @@ impl BufferQueue {
None => assert_eq!(consumed_from_last, 0),
Some((i, _buf)) => {
*i += consumed_from_last;
- },
+ }
}
Some(true)