fix: resolve all cargo clippy warnings
- Fix toml version requirement metadata warning - Replace clone() with std::slice::from_ref() - Collapse nested if statements - Add #[allow(dead_code)] to test utility functions - Fix unused imports and variables in tests - Use unwrap_or_else instead of expect with format!
This commit is contained in:
@@ -19,14 +19,13 @@ fn detect_project_name(root: &str) -> String {
|
||||
in_project = false;
|
||||
continue;
|
||||
}
|
||||
if in_project && trimmed.starts_with("name") {
|
||||
if let Some(val) = trimmed.split('=').nth(1) {
|
||||
if in_project && trimmed.starts_with("name")
|
||||
&& let Some(val) = trimmed.split('=').nth(1) {
|
||||
let name = val.trim().trim_matches('"').trim_matches('\'');
|
||||
if !name.is_empty() {
|
||||
return name.to_string();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user