Skip to content

Commit 47a4d04

Browse files
committed
Use better pattern matching
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
1 parent 727d627 commit 47a4d04

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ pub fn ask<Q: AsRef<str>, In: Read, Out: Write>(
162162
consume_bytes!(1);
163163
}
164164

165-
match buf.filled().iter().position(|b| *b == b'\n' || *b == b'\r') {
165+
match buf.filled().iter().position(|&b| b == b'\n' || b == b'\r') {
166166
Some(newline_index) if newline_index == BUF_LEN - 1 => {
167167
let pending_crlf = buf.filled()[newline_index] == b'\r';
168168
buf.clear();

0 commit comments

Comments
 (0)