Fix clippy::collapsible_match warning in safe_name

Co-authored-by: Horizontal42 <75383519+Horizontal42@users.noreply.github.com>
This commit is contained in:
google-labs-jules[bot] 2026-07-29 00:13:48 +00:00
parent e183f58af1
commit 6ac39d828e

View file

@ -38,12 +38,8 @@ fn safe_name(name: &str) -> bool {
let path = Path::new(name);
let mut components = path.components();
match components.next() {
Some(std::path::Component::Normal(_)) => {
if components.next().is_none() {
!name.contains(['/', '\\', ':'])
} else {
false
}
Some(std::path::Component::Normal(_)) if components.next().is_none() => {
!name.contains(['/', '\\', ':'])
}
_ => false,
}