mirror of
https://github.com/Horizontal42/summarum.git
synced 2026-11-11 01:02:01 +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 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,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue