diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-01 20:59:06 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-01 21:00:25 +0900 |
| commit | 41655c14ad33f9eed6efcc4490a604a0e2defa4b (patch) | |
| tree | c33d7f4c849894ab6893e5a49aa1ccd17c084b4c /crates/mozart/src/commands/licenses.rs | |
| parent | 6d36c654b094dbef823850e9a90047d8bafc1adc (diff) | |
| download | php-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/licenses.rs')
| -rw-r--r-- | crates/mozart/src/commands/licenses.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/mozart/src/commands/licenses.rs b/crates/mozart/src/commands/licenses.rs index 9a46c94..50aaebe 100644 --- a/crates/mozart/src/commands/licenses.rs +++ b/crates/mozart/src/commands/licenses.rs @@ -722,7 +722,7 @@ mod tests { let entries: Vec<LicenseEntry> = vec![]; // Single license string becomes a one-element array in JSON output - let root_licenses = vec!["MIT".to_string()]; + let root_licenses = ["MIT".to_string()]; let root_license_arr: Vec<serde_json::Value> = root_licenses .iter() .map(|s| serde_json::Value::String(s.clone())) @@ -737,7 +737,7 @@ mod tests { assert_eq!(output["license"][0], "MIT"); // Multiple licenses are also emitted as an array - let root_licenses_multi = vec!["MIT".to_string(), "Apache-2.0".to_string()]; + let root_licenses_multi = ["MIT".to_string(), "Apache-2.0".to_string()]; let root_license_arr_multi: Vec<serde_json::Value> = root_licenses_multi .iter() .map(|s| serde_json::Value::String(s.clone())) |
