Skip to content

Commit 892b8a0

Browse files
Boshenclaude
andcommitted
fix(lint): resolve new clippy warnings from nightly upgrade
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e532ac6 commit 892b8a0

3 files changed

Lines changed: 4 additions & 6 deletions

File tree

crates/vite_select/src/fuzzy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub fn fuzzy_match(query: &str, items: &[&str]) -> Vec<usize> {
2626
})
2727
.collect();
2828

29-
scored.sort_by(|a, b| b.1.cmp(&a.1));
29+
scored.sort_by_key(|b| std::cmp::Reverse(b.1));
3030
scored.into_iter().map(|(idx, _)| idx).collect()
3131
}
3232

crates/vite_tui/src/components/tasks_list.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,8 @@ impl Component for TasksList {
6262
match action {
6363
Action::Up => self.up(),
6464
Action::Down => self.down(),
65-
Action::SelectTask(index) => {
66-
if index < self.tasks.len() {
67-
self.select(index);
68-
}
65+
Action::SelectTask(index) if index < self.tasks.len() => {
66+
self.select(index);
6967
}
7068
_ => {}
7169
}

crates/vite_workspace/src/package.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub struct PackageJson {
2727

2828
impl std::fmt::Debug for PackageJson {
2929
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
30-
if std::env::var("VITE_DEBUG_VERBOSE").map(|v| v != "0" && v != "false").unwrap_or(false) {
30+
if std::env::var("VITE_DEBUG_VERBOSE").is_ok_and(|v| v != "0" && v != "false") {
3131
write!(
3232
f,
3333
"PackageJson {{ name: {:?}, scripts: {:?}, dependencies: {:?}, dev_dependencies: {:?}, peer_dependencies: {:?} }}",

0 commit comments

Comments
 (0)