Skip to content

Instantly share code, notes, and snippets.

@daschl
Created August 18, 2017 16:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daschl/5639b97e8a44d4806463e25af291ebfb to your computer and use it in GitHub Desktop.
Save daschl/5639b97e8a44d4806463e25af291ebfb to your computer and use it in GitHub Desktop.
let (complete_sender, complete_receiver) = oneshot::channel::<()>();
ctrlc::set_handler(move || {
complete_sender.send(());
}).expect("Error setting Ctrl-C handler");
error[E0507]: cannot move out of captured outer variable in an `Fn` closure
--> src/lib.rs:30:13
|
28 | let (complete_sender, complete_receiver) = oneshot::channel::<()>();
| --------------- captured outer variable
29 | ctrlc::set_handler(move || {
30 | complete_sender.send(());
| ^^^^^^^^^^^^^^^ cannot move out of captured outer variable in an `Fn` closure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment