We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bcd8c52 commit 14bec09Copy full SHA for 14bec09
src/util.rs
@@ -6,11 +6,10 @@ pub fn parse_update_count(tag: String) -> u64 {
6
}
7
8
pub fn read_all<R: Read>(r: &mut R, mut buf: &mut [u8]) -> io::Result<()> {
9
- let mut start = 0;
10
- while start != buf.len() {
11
- match r.read(&mut buf[start..]) {
+ while !buf.is_empty() {
+ match r.read(buf) {
12
Ok(0) => return Err(io::Error::new(io::ErrorKind::Other, "unexpected EOF")),
13
- Ok(len) => start += len,
+ Ok(len) => buf = &mut {buf}[len..],
14
Err(ref e) if e.kind() == io::ErrorKind::Interrupted => {}
15
Err(e) => return Err(e),
16
0 commit comments