diff options
author | Alex Auvolat <alex@adnab.me> | 2022-09-01 12:15:50 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-09-01 12:15:50 +0200 |
commit | cd203f5708907c2bf172a3c5b7c5b40e2557b2f4 (patch) | |
tree | 8b3eb284106d0f6b5af1ad4ad447c8004ff4c6f5 /src/recv.rs | |
parent | 745c78618479c4177647e4d7fed97d5fd2d00d4f (diff) | |
download | netapp-cd203f5708907c2bf172a3c5b7c5b40e2557b2f4.tar.gz netapp-cd203f5708907c2bf172a3c5b7c5b40e2557b2f4.zip |
Add OrderTag to Req and Resp, refactor errors
Diffstat (limited to 'src/recv.rs')
-rw-r--r-- | src/recv.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/recv.rs b/src/recv.rs index f8606f3..b5289fb 100644 --- a/src/recv.rs +++ b/src/recv.rs @@ -35,7 +35,10 @@ impl Sender { impl Drop for Sender { fn drop(&mut self) { if let Some(inner) = self.inner.take() { - let _ = inner.send(Err(std::io::Error::new(std::io::ErrorKind::BrokenPipe, "Netapp connection dropped before end of stream"))); + let _ = inner.send(Err(std::io::Error::new( + std::io::ErrorKind::BrokenPipe, + "Netapp connection dropped before end of stream", + ))); } } } @@ -82,7 +85,8 @@ pub(crate) trait RecvLoop: Sync + 'static { let packet = if is_error { let kind = u8_to_io_errorkind(next_slice[0]); - let msg = std::str::from_utf8(&next_slice[1..]).unwrap_or("<invalid utf8 error message>"); + let msg = + std::str::from_utf8(&next_slice[1..]).unwrap_or("<invalid utf8 error message>"); debug!("recv_loop: got id {}, error {:?}: {}", id, kind, msg); Some(Err(std::io::Error::new(kind, msg.to_string()))) } else { |