Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve manual_let_else clippy lints in experimental-enum-variants-fr…
…om-header warning: this could be rewritten as `let...else` --> macro/src/load.rs:107:13 | 107 | / let name = match &decl.name { 108 | | Some(name) => name, 109 | | // Can ignore enums inside an anonymous namespace. 110 | | None => return, 111 | | }; | |______________^ help: consider writing: `let Some(name) = &decl.name else { return };` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else = note: `-W clippy::manual-let-else` implied by `-W clippy::pedantic` = help: to override `-W clippy::pedantic` add `#[allow(clippy::manual_let_else)]` warning: this could be rewritten as `let...else` --> macro/src/load.rs:116:13 | 116 | / let name = match &decl.name { 117 | | Some(name) => name, 118 | | None => return, 119 | | }; | |______________^ help: consider writing: `let Some(name) = &decl.name else { return };` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else warning: this could be rewritten as `let...else` --> macro/src/load.rs:130:21 | 130 | / let fixed_underlying_type = match &decl.fixed_underlying_type { 131 | | Some(fixed_underlying_type) => fixed_underlying_type, 132 | | None => { 133 | | let span = &enm.variants_from_header_attr; ... | 143 | | }; | |______________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else help: consider writing | 130 ~ let Some(fixed_underlying_type) = &decl.fixed_underlying_type else { 131 + let span = &enm.variants_from_header_attr; 132 + let name = &enm.name.cxx; 133 + let qual_name = CxxName(&enm.name); 134 + let msg = format!( 135 + "implicit implementation-defined repr for enum {} is not supported yet; consider changing its C++ definition to `enum {}: int {{...}}", 136 + qual_name, name, 137 + ); 138 + cx.error(span, msg); 139 + return; 140 + }; | warning: this could be rewritten as `let...else` --> macro/src/load.rs:172:17 | 172 | / let cxx_name = match ForeignName::parse(&decl.name, span) { 173 | | Ok(foreign_name) => foreign_name, 174 | | Err(_) => { 175 | | let span = &enm.variants_from_header_attr; ... | 179 | | }; | |__________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else help: consider writing | 172 ~ let Ok(cxx_name) = ForeignName::parse(&decl.name, span) else { 173 + let span = &enm.variants_from_header_attr; 174 + let msg = format!("unsupported C++ variant name: {}", decl.name); 175 + return cx.error(span, msg); 176 + }; |
- Loading branch information