Skip to content

Commit

Permalink
Replace matches! with manual if-let
Browse files Browse the repository at this point in the history
  • Loading branch information
nico-abram committed Apr 20, 2022
1 parent 238cf37 commit b1caaf1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,13 @@ pub fn glob_with(pattern: &str, options: MatchOptions) -> Result<Paths, PatternE
fn check_windows_verbatim(p: &Path) -> bool {
match p.components().next() {
Some(Component::Prefix(ref p)) => {
p.kind().is_verbatim() && !matches!(p.kind(), std::path::Prefix::VerbatimDisk(_))
// Allow VerbatimDisk paths. std canonicalize() generates them, and they work fine
p.kind().is_verbatim()
&& if let std::path::Prefix::VerbatimDisk(_) = p.kind() {
false
} else {
true
}
}
_ => false,
}
Expand Down

0 comments on commit b1caaf1

Please sign in to comment.