We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 81e87ee commit eefc507Copy full SHA for eefc507
crates/net/p2p/src/req_resp/codec.rs
@@ -215,10 +215,11 @@ where
215
loop {
216
// Read chunk result code
217
let mut result_byte = 0_u8;
218
- match io.read_exact(std::slice::from_mut(&mut result_byte)).await {
219
- Ok(()) => {}
220
- Err(e) if e.kind() == io::ErrorKind::UnexpectedEof => break,
221
- Err(e) => return Err(e),
+ if let Err(e) = io.read_exact(std::slice::from_mut(&mut result_byte)).await {
+ if e.kind() == io::ErrorKind::UnexpectedEof {
+ break;
+ }
222
+ return Err(e);
223
}
224
225
let code = ResponseCode::from(result_byte);
0 commit comments