summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2021-11-19 07:54:49 +0100
committerMartin Fischer <martin@push-f.com>2021-11-19 07:54:49 +0100
commit29f4f54fdb173c93f17b8515e7cb459d78bc0068 (patch)
tree491ffebfe4cbd04326205ff54f084b92d209c682 /src/util
parentc914b71a28ce7177171b83df2815352bf5741844 (diff)
format code with cargo fmt
Diffstat (limited to 'src/util')
-rw-r--r--src/util/buffer_queue.rs12
-rw-r--r--src/util/str.rs2
2 files changed, 8 insertions, 6 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)
diff --git a/src/util/str.rs b/src/util/str.rs
index c3185a0..bf38fe1 100644
--- a/src/util/str.rs
+++ b/src/util/str.rs
@@ -35,7 +35,7 @@ mod test {
fn $name() {
assert_eq!($left, $right);
}
- }
+ };
}
test_eq!(lower_letter_a_is_a, lower_ascii_letter('a'), Some('a'));