diff options
| author | 魏曹先生 <1992414357@qq.com> | 2025-10-14 17:19:24 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2025-10-14 17:19:24 +0800 |
| commit | 293d53c0e3f2f4191bd1ae209efda820333afabd (patch) | |
| tree | 6535f91b87690400a501435a598d1044847e81dc /crates | |
| parent | 0cd19e64d4d255e45233255478ca3a0bd5c439ae (diff) | |
style: fix clippy warnings and improve code quality
- Replace redundant pattern matching with is_err() method
- Remove unnecessary braces in unwrap_or_else closures
- Improve code formatting and consistency
Diffstat (limited to 'crates')
| -rw-r--r-- | crates/cli_publisher/src/main.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/cli_publisher/src/main.rs b/crates/cli_publisher/src/main.rs index 7e6555a..edc7e9c 100644 --- a/crates/cli_publisher/src/main.rs +++ b/crates/cli_publisher/src/main.rs @@ -38,8 +38,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> { continue; } - if let Some(file_name) = path.file_name().and_then(|n| n.to_str()) { - if publish_binaries.contains(&file_name.to_string()) { + if let Some(file_name) = path.file_name().and_then(|n| n.to_str()) + && publish_binaries.contains(&file_name.to_string()) { let parent_dir_name = path .parent() .and_then(|p| p.file_name()) @@ -62,7 +62,6 @@ fn main() -> Result<(), Box<dyn std::error::Error>> { std::fs::copy(&path, &dest_path)?; copied_files += 1; } - } } } |
