A lint to ensure all `.is_*()` methods are implemented would be nice. pub enum Bool True, False } impl Bool { pub fn is_true(&self) -> bool { *self == Bool::True } pub fn is_false(&self) -> bool { *self == Bool::False } }
Do you mean something like: if gen_pasta()::Tagliatelle {println!("serving tagliatelle");}
-
-
if let *::Tagliatelle = get_pasta() {}
-
yeah, that's nicer IMHO, less boilerplate, and ideally as forward-compatible with `#[non_exhaustive]`. Swift has something like that, I think their syntax would be something like `if let .Penne = get_pasta() { … }` in Rust
- 9 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.