mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-03 00:00:05 +02:00
Ctrl+C example: clarify control flow after receiving Ctrl+C: unreachable!()
This commit is contained in:
@@ -23,4 +23,7 @@ fn main() {
|
|||||||
println!("Ctrl-C received!");
|
println!("Ctrl-C received!");
|
||||||
Ok(())
|
Ok(())
|
||||||
})).unwrap();
|
})).unwrap();
|
||||||
|
|
||||||
|
println!("this won't be printed, because the received Ctrl+C will also kill the program");
|
||||||
|
unreachable!();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user