mirror of
https://github.com/Horizontal42/summarum.git
synced 2026-11-10 19:11:58 +03:00
fix clippy collapsible_match warning in safe_name
This commit is contained in:
parent
a6fc5b90f3
commit
5c4f2db2d2
1 changed files with 2 additions and 6 deletions
|
|
@ -38,12 +38,8 @@ fn safe_name(name: &str) -> bool {
|
||||||
let path = Path::new(name);
|
let path = Path::new(name);
|
||||||
let mut components = path.components();
|
let mut components = path.components();
|
||||||
match components.next() {
|
match components.next() {
|
||||||
Some(std::path::Component::Normal(_)) => {
|
Some(std::path::Component::Normal(_)) if components.next().is_none() => {
|
||||||
if components.next().is_none() {
|
!name.contains(['/', '\\', ':'])
|
||||||
!name.contains(['/', '\\', ':'])
|
|
||||||
} else {
|
|
||||||
false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
_ => false,
|
_ => false,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue