Skip to content

Commit e88f753

Browse files
committed
Improve single arm match.
1 parent df31abe commit e88f753

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

vm/src/stdlib/hashlib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,9 @@ fn hashlib_new(
106106
other => Err(vm.new_value_error(format!("Unknown hashing algorithm: {}", other))),
107107
}?;
108108

109-
match data {
110-
OptionalArg::Present(data) => hasher.update(data, vm).map(|_| ())?,
111-
OptionalArg::Missing => (),
112-
};
109+
if let OptionalArg::Present(data) = data {
110+
hasher.update(data, vm)?;
111+
}
113112

114113
Ok(hasher)
115114
}

0 commit comments

Comments
 (0)