aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart/src/commands/suggests.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-01 20:59:06 +0900
committernsfisis <nsfisis@gmail.com>2026-05-01 21:00:25 +0900
commit41655c14ad33f9eed6efcc4490a604a0e2defa4b (patch)
treec33d7f4c849894ab6893e5a49aa1ccd17c084b4c /crates/mozart/src/commands/suggests.rs
parent6d36c654b094dbef823850e9a90047d8bafc1adc (diff)
downloadphp-mozart-41655c14ad33f9eed6efcc4490a604a0e2defa4b.tar.gz
php-mozart-41655c14ad33f9eed6efcc4490a604a0e2defa4b.tar.zst
php-mozart-41655c14ad33f9eed6efcc4490a604a0e2defa4b.zip
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) <noreply@anthropic.com>
Diffstat (limited to 'crates/mozart/src/commands/suggests.rs')
-rw-r--r--crates/mozart/src/commands/suggests.rs8
1 files changed, 4 insertions, 4 deletions
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", ""),