Skip to content

Commit 2ae8843

Browse files
committed
Remove unnecessary block
(Review in whitespace changes ignored mode)
1 parent 91755fe commit 2ae8843

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

src/reader/buffered_reader.rs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -101,31 +101,31 @@ macro_rules! impl_buffered_source {
101101
let mut read = 0;
102102
let start = buf.len();
103103
loop {
104-
let used = {
105-
let available = match self $(.$reader)? .fill_buf() $(.$await)? {
106-
Ok(n) if n.is_empty() => break,
107-
Ok(n) => n,
108-
Err(ref e) if e.kind() == io::ErrorKind::Interrupted => continue,
109-
Err(e) => {
110-
*position += read;
111-
return Err(Error::Io(e.into()));
112-
}
113-
};
104+
let available = match self $(.$reader)? .fill_buf() $(.$await)? {
105+
Ok(n) if n.is_empty() => break,
106+
Ok(n) => n,
107+
Err(ref e) if e.kind() == io::ErrorKind::Interrupted => continue,
108+
Err(e) => {
109+
*position += read;
110+
return Err(Error::Io(e.into()));
111+
}
112+
};
114113

115-
if let Some(i) = parser.feed(available) {
116-
buf.extend_from_slice(&available[..i]);
114+
if let Some(i) = parser.feed(available) {
115+
buf.extend_from_slice(&available[..i]);
117116

118-
// +1 for `>` which we do not include
119-
self $(.$reader)? .consume(i + 1);
120-
read += i + 1;
117+
// +1 for `>` which we do not include
118+
self $(.$reader)? .consume(i + 1);
119+
read += i + 1;
121120

122-
*position += read;
123-
return Ok(&buf[start..]);
124-
}
121+
*position += read;
122+
return Ok(&buf[start..]);
123+
}
125124

126-
buf.extend_from_slice(available);
127-
available.len()
128-
};
125+
// The `>` symbol not yet found, continue reading
126+
buf.extend_from_slice(available);
127+
128+
let used = available.len();
129129
self $(.$reader)? .consume(used);
130130
read += used;
131131
}

0 commit comments

Comments
 (0)