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/licenses.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/mozart/src/commands/licenses.rs') 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 = 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 = 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 = root_licenses_multi .iter() .map(|s| serde_json::Value::String(s.clone())) -- cgit v1.3.1