Skip to content

Instantly share code, notes, and snippets.

@eknowlton
Last active August 22, 2019 22:23
Show Gist options
  • Save eknowlton/7e61269d21329f824781d4e036892918 to your computer and use it in GitHub Desktop.
Save eknowlton/7e61269d21329f824781d4e036892918 to your computer and use it in GitHub Desktop.
// get `IDLE` handle
match session.idle() {
Err(error) => {
println!("Failed to send command: IDLE");
println!("IMAP server may not support IDLE command.");
println!("Error: {}", error);
std::process::exit(126);
}
Ok(idle) => {
println!("Waiting for Ctrl-C...");
while running.load(Ordering::SeqCst) {
idle.wait_keepalive();
// ^ -- Moved value being used here
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment