Skip to content

Commit

Permalink
Book: Signals: Rename "ctrl+c presses" channel
Browse files Browse the repository at this point in the history
  • Loading branch information
killercup committed Dec 7, 2018
1 parent 4276518 commit a51d58b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/in-depth/signals-channels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ fn ctrl_channel() -> Result<Receiver<()>, ctrlc::Error> {
}

fn main() -> Result<(), exitfailure::ExitFailure> {
let ctrls = ctrl_channel()?;
let ctrl_c_events = ctrl_channel()?;
let ticks = tick(Duration::from_secs(1));

loop {
select! {
recv(ticks) -> _ => {
println!("working!");
}
recv(ctrls) -> _ => {
recv(ctrl_c_events) -> _ => {
println!();
println!("Goodbye!");
break;
Expand Down

0 comments on commit a51d58b

Please sign in to comment.