diff --git a/examples/logs.rs b/examples/logs.rs index 6d4efd1..871804a 100644 --- a/examples/logs.rs +++ b/examples/logs.rs @@ -36,8 +36,10 @@ fn generate_logs(tx: mpsc::Sender) { loop { let line = format!("Interesting log line {}", i); i += 1; + // The send will fail when the other side is dropped. + // (When the application ends). match tx.send(line) { - Err(_) => panic!("Uh?..."), + Err(_) => return, Ok(_) => (), } thread::sleep_ms(30);