mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-28 14:03:35 +00:00
7e8f9c82e1
feat: add bool_to_enum assist for parameters ## Summary This PR adds parameter support for `bool_to_enum` assists. Essentially, the assist can now transform this: ```rs fn function($0foo: bool) { if foo { println!("foo"); } } ``` To this, ```rs #[derive(PartialEq, Eq)] enum Bool { True, False } fn function(foo: Bool) { if foo == Bool::True { println!("foo"); } } ``` Thanks to `@/davidbarsky` for the test skeleton (: Closes #17400 |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |