diff options
Diffstat (limited to 'vendor/gix-packetline/src/read/blocking_io.rs')
-rw-r--r-- | vendor/gix-packetline/src/read/blocking_io.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/vendor/gix-packetline/src/read/blocking_io.rs b/vendor/gix-packetline/src/read/blocking_io.rs index 6af660b7f..50c634c4c 100644 --- a/vendor/gix-packetline/src/read/blocking_io.rs +++ b/vendor/gix-packetline/src/read/blocking_io.rs @@ -31,7 +31,7 @@ where } /// This function is needed to help the borrow checker allow us to return references all the time - /// It contains a bunch of logic shared between peek and read_line invocations. + /// It contains a bunch of logic shared between peek and `read_line` invocations. fn read_line_inner_exhaustive<'a>( reader: &mut T, buf: &'a mut Vec<u8>, @@ -45,7 +45,7 @@ where Some(match Self::read_line_inner(reader, buf) { Ok(Ok(line)) => { if delimiters.contains(&line) { - let stopped_at = delimiters.iter().find(|l| **l == line).cloned(); + let stopped_at = delimiters.iter().find(|l| **l == line).copied(); buf.clear(); return (true, stopped_at, None); } else if fail_on_err_lines { @@ -62,10 +62,7 @@ where ); } } - let len = line - .as_slice() - .map(|s| s.len() + U16_HEX_BYTES) - .unwrap_or(U16_HEX_BYTES); + let len = line.as_slice().map_or(U16_HEX_BYTES, |s| s.len() + U16_HEX_BYTES); if buf_resize { buf.resize(len, 0); } |