Skip to content

Commit 35015bf

Browse files
committed
Remove redundant pattern matching
Clippy emits two warnings of the form: warning: redundant pattern matching, consider using ... As suggested use `is_none` and `is_ok` where appropriate.
1 parent ad51d83 commit 35015bf

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/miniscript/analyzable.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,7 @@ impl<Pk: MiniscriptKey, Ctx: ScriptContext> Miniscript<Pk, Ctx> {
8383
// It maybe possible to return a detail error type containing why the miniscript
8484
// failed. But doing so may require returning a collection of errors
8585
pub fn within_resource_limits(&self) -> bool {
86-
match Ctx::check_local_validity(self) {
87-
Ok(_) => true,
88-
Err(_) => false,
89-
}
86+
Ctx::check_local_validity(self).is_ok()
9087
}
9188

9289
/// Whether the miniscript contains a combination of timelocks

src/miniscript/iter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ impl<'a, Pk: MiniscriptKey, Ctx: ScriptContext> Iterator for Iter<'a, Pk, Ctx> {
258258
/// To enumerate the branches iterator uses [Miniscript::branches] function.
259259
fn next(&mut self) -> Option<Self::Item> {
260260
let mut curr = self.next;
261-
if let None = curr {
261+
if curr.is_none() {
262262
while let Some((node, child)) = self.path.pop() {
263263
curr = node.get_nth_child(child);
264264
if curr.is_some() {

0 commit comments

Comments
 (0)