diff options
Diffstat (limited to 'examples/print_each_packet.rs')
-rw-r--r-- | examples/print_each_packet.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/print_each_packet.rs b/examples/print_each_packet.rs index f056db4a..4604139b 100644 --- a/examples/print_each_packet.rs +++ b/examples/print_each_packet.rs @@ -65,7 +65,9 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { // Allow passing an address to listen on as the first argument of this // program, but otherwise we'll just set up our TCP listener on // 127.0.0.1:8080 for connections. - let addr = env::args().nth(1).unwrap_or("127.0.0.1:8080".to_string()); + let addr = env::args() + .nth(1) + .unwrap_or_else(|| "127.0.0.1:8080".to_string()); // Next up we create a TCP listener which will listen for incoming // connections. This TCP listener is bound to the address we determined |