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 7761222 commit 1b5ea98Copy full SHA for 1b5ea98
src/io/recv_from.rs
@@ -65,11 +65,12 @@ where
65
// Recover the buffer
66
let mut buf = self.buf;
67
68
- let socket_addr = (*self.socket_addr).as_socket();
+ let socket_addr = match (*self.socket_addr).as_socket() {
69
+ Some(sa) => sa,
70
+ None => return (Err(io::Error::from(io::ErrorKind::AddrNotAvailable)), buf),
71
+ };
72
73
let res = res.map(|n| {
- let socket_addr: SocketAddr = socket_addr.unwrap();
-
74
// Safety: the kernel wrote `n` bytes to the buffer.
75
unsafe {
76
buf.set_init(n);
0 commit comments