From 4ac55c54ce7c3d080d9f56697b21a396c891e633 Mon Sep 17 00:00:00 2001 From: Cole Faust Date: Fri, 15 May 2026 18:07:11 -0700 Subject: [PATCH] Fix new clippy errors --- src-rs/dep.rs | 6 ++---- src-rs/stats.rs | 2 +- src-rs/strutil.rs | 6 ++---- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src-rs/dep.rs b/src-rs/dep.rs index eef6e4d6..3f322059 100644 --- a/src-rs/dep.rs +++ b/src-rs/dep.rs @@ -939,10 +939,8 @@ impl<'a> DepBuilder<'a> { ); } } - Some(AssignOp::QuestionEq) => { - if self.ev.lookup_var(*name)?.is_some() { - continue; - } + Some(AssignOp::QuestionEq) if self.ev.lookup_var(*name)?.is_some() => { + continue; } _ => {} } diff --git a/src-rs/stats.rs b/src-rs/stats.rs index c78751c5..114268c1 100644 --- a/src-rs/stats.rs +++ b/src-rs/stats.rs @@ -71,7 +71,7 @@ impl Stats { .iter() .map(|(k, v)| (k.clone(), v.clone())) .collect::>(); - detailed.sort_by(|a, b| b.1.elapsed.cmp(&a.1.elapsed)); + detailed.sort_by_key(|b| std::cmp::Reverse(b.1.elapsed)); // Only print the top 10 detailed.truncate(10); diff --git a/src-rs/strutil.rs b/src-rs/strutil.rs index 2dacbe8b..6f3435f8 100644 --- a/src-rs/strutil.rs +++ b/src-rs/strutil.rs @@ -347,10 +347,8 @@ pub fn find_outside_paren(s: &[u8], pattern: &[u8]) -> Option { match c { b'(' => paren_stack.push(b')'), b'{' => paren_stack.push(b'}'), - b')' | b'}' => { - if paren_stack.last() == Some(c) { - paren_stack.pop(); - } + b')' | b'}' if paren_stack.last() == Some(c) => { + paren_stack.pop(); } _ => {} }