diff options
Diffstat (limited to 'examples/chat.rs')
-rw-r--r-- | examples/chat.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/chat.rs b/examples/chat.rs index 2553cc5e..91589072 100644 --- a/examples/chat.rs +++ b/examples/chat.rs @@ -49,7 +49,9 @@ async fn main() -> Result<(), Box<dyn Error>> { // client connection. let state = Arc::new(Mutex::new(Shared::new())); - let addr = env::args().nth(1).unwrap_or("127.0.0.1:6142".to_string()); + let addr = env::args() + .nth(1) + .unwrap_or_else(|| "127.0.0.1:6142".to_string()); // Bind a TCP listener to the socket address. // |