Skip to content

Commit bd22858

Browse files
committed
clippy: turn on manual_let_else lint
Ok, this one might be controversial :). Purely stylistic. Uses the new `let...else` syntax. Saves a line of code.
1 parent ec358cc commit bd22858

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ manual_assert = "warn"
103103
manual_instant_elapsed = "warn"
104104
manual_is_power_of_two = "warn"
105105
manual_is_variant_and = "warn"
106-
manual_let_else = "allow"
106+
manual_let_else = "warn"
107107
manual_ok_or = "warn"
108108
manual_string_new = "warn"
109109
many_single_char_names = "warn"

src/witness.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,8 @@ impl WitnessValues {
114114
/// witnesses will be pruned and which won't be pruned. This check skips unassigned witnesses.
115115
pub fn is_consistent(&self, witness_types: &WitnessTypes) -> Result<(), Error> {
116116
for name in self.0.keys() {
117-
let declared_ty = match witness_types.get(name) {
118-
Some(ty) => ty,
119-
None => continue,
117+
let Some(declared_ty) = witness_types.get(name) else {
118+
continue;
120119
};
121120
let assigned_ty = self.0[name].ty();
122121
if assigned_ty != declared_ty {

0 commit comments

Comments
 (0)