From 41655c14ad33f9eed6efcc4490a604a0e2defa4b Mon Sep 17 00:00:00 2001 From: nsfisis Date: Fri, 1 May 2026 20:59:06 +0900 Subject: refactor: fix clippy warnings Replace if-let/else-return with `?`, swap `as_ref().map(|k| k.as_slice())` for `as_deref()`, and switch test fixtures from `vec\![]` to array literals where ownership is unneeded. Co-Authored-By: Claude Opus 4.7 (1M context) --- crates/mozart/src/commands/suggests.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/mozart/src/commands/suggests.rs') diff --git a/crates/mozart/src/commands/suggests.rs b/crates/mozart/src/commands/suggests.rs index 1dd898f..9a43211 100644 --- a/crates/mozart/src/commands/suggests.rs +++ b/crates/mozart/src/commands/suggests.rs @@ -639,7 +639,7 @@ mod tests { #[test] fn test_filter_removes_installed_targets() { - let suggestions = vec![ + let suggestions = [ make_suggestion("vendor/a", "ext-intl", "for internationalization"), make_suggestion("vendor/b", "vendor/optional", "for extra features"), make_suggestion("vendor/c", "ext-mbstring", "for string processing"), @@ -662,7 +662,7 @@ mod tests { #[test] fn test_filter_by_package_names() { - let suggestions = vec![ + let suggestions = [ make_suggestion("vendor/a", "vendor/x", "reason"), make_suggestion("vendor/b", "vendor/y", "reason"), make_suggestion("vendor/c", "vendor/z", "reason"), @@ -686,7 +686,7 @@ mod tests { #[test] fn test_filter_direct_deps_only() { - let suggestions = vec![ + let suggestions = [ make_suggestion("vendor/direct", "vendor/x", "reason"), make_suggestion("vendor/transitive", "vendor/y", "reason"), ]; @@ -707,7 +707,7 @@ mod tests { #[test] fn test_filter_no_filter() { - let suggestions = vec![ + let suggestions = [ make_suggestion("vendor/a", "vendor/x", ""), make_suggestion("vendor/b", "vendor/y", ""), make_suggestion("vendor/c", "vendor/z", ""), -- cgit v1.3.1