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 a8acdba commit fef8ef8Copy full SHA for fef8ef8
examples/mioudp/src/main.rs
@@ -1,7 +1,6 @@
1
//! Adapted from <https://github.com/tokio-rs/mio/blob/c9831c78d14fd54c41bab79f5347764a56dc8326/examples/udp_server.rs>.
2
3
use std::io;
4
-use std::str::from_utf8;
5
6
#[cfg(target_os = "hermit")]
7
use hermit as _;
@@ -63,11 +62,6 @@ fn main() -> io::Result<()> {
63
62
Ok((packet_size, source_address)) => {
64
// Echo the data.
65
socket.send_to(&buf[..packet_size], source_address)?;
66
- if let Ok(str_buf) = from_utf8(&buf[..packet_size]) {
67
- if str_buf.trim_end() == "exit" {
68
- return Ok(());
69
- }
70
71
}
72
Err(e) if e.kind() == io::ErrorKind::WouldBlock => {
73
// If we get a `WouldBlock` error we know our socket
0 commit comments