- not
Toggle
- ! is the not-operator
examples/booleans/toggle/src/main.rs
fn main() { let mut t = true; println!("{t}"); t = !t; println!("{t}"); t = !t; println!("{t}"); }
true false true
fn main() { let mut t = true; println!("{t}"); t = !t; println!("{t}"); t = !t; println!("{t}"); }
true false true