Re:Rust 1.100.0
by thayne on Thursday November 12, 2026 @09:26PM
(#50477313)
If you have a (&must) reference it would actually be x = !x. Also toggle is a function that can be passed to higher order functions without needing a lambda. For example, if you have a boolean in an option you can do opt.iter_mut().for_each(book::toggle). Or similar if you had a collection of booleans.
[ Parent
| on HN ]
There are no comments on this comment yet.