Re:Rust 1.56.0 and Rust 2021
by luizfelberti on Thursday October 21, 2021 @04:03PM
(#28950134)
Ooh I forgot the language had those!
I still feel like this trick has it's place though, as an example take a look at where I stole this trick from, by matklad [0] and tell me what you think :)
Re:Rust 1.56.0 and Rust 2021
by lilyball on Thursday October 28, 2021 @01:52PM
(#29028951)
I think that this code is acceptable as long as you're careful. And I wish Rust had a `#[derive(TryFrom)]` sort of thing for deriving conversions from the declared primitive type to the enum.
I still feel like this trick has it's place though, as an example take a look at where I stole this trick from, by matklad [0] and tell me what you think :)
[0] https://github.com/rust-analyzer/rowan/blob/d2c7843858da9d9e...