MISRA
MISRA
Posted Sep 19, 2021 18:12 UTC (Sun) by tialaramex (subscriber, #21167)In reply to: MISRA by NYKevin
Parent article: Conill: The long-term consequences of maintainers’ actions
https://play.rust-lang.org/?version=stable&mode=debug...
The compiler points out that two of the arms are clearly integers while another is an &str (in this case a string literal).
In many cases the idiomatic Rust way to express what you wanted actually does involve values from each arm, but of course it is possible for your match to be full of procedural code in which case those values are just the empty tuple -- or for it to have statements which outright leave the match (such as "return" or "break") and these are in fact type compatible with anything.
