diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
commit | dc0db358abe19481e475e10c32149b53370f1a1c (patch) | |
tree | ab8ce99c4b255ce46f99ef402c27916055b899ee /vendor/gix-packetline/src/read/async_io.rs | |
parent | Releasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff) | |
download | rustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip |
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/gix-packetline/src/read/async_io.rs')
-rw-r--r-- | vendor/gix-packetline/src/read/async_io.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/vendor/gix-packetline/src/read/async_io.rs b/vendor/gix-packetline/src/read/async_io.rs index bb4dcf2c1..402c2434b 100644 --- a/vendor/gix-packetline/src/read/async_io.rs +++ b/vendor/gix-packetline/src/read/async_io.rs @@ -37,7 +37,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. async fn read_line_inner_exhaustive<'a>( reader: &mut T, buf: &'a mut Vec<u8>, @@ -51,7 +51,7 @@ where Some(match Self::read_line_inner(reader, buf).await { 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 { @@ -68,10 +68,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); } |