mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-23 17:35:00 +00:00
Don't panic in log generator
This commit is contained in:
parent
9fc946d6bd
commit
e59a2d4dd7
@ -36,8 +36,10 @@ fn generate_logs(tx: mpsc::Sender<String>) {
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user