Skip to content

Commit b1caaf1

Browse files
committed
Replace matches! with manual if-let
1 parent 238cf37 commit b1caaf1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/lib.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,13 @@ pub fn glob_with(pattern: &str, options: MatchOptions) -> Result<Paths, PatternE
179179
fn check_windows_verbatim(p: &Path) -> bool {
180180
match p.components().next() {
181181
Some(Component::Prefix(ref p)) => {
182-
p.kind().is_verbatim() && !matches!(p.kind(), std::path::Prefix::VerbatimDisk(_))
182+
// Allow VerbatimDisk paths. std canonicalize() generates them, and they work fine
183+
p.kind().is_verbatim()
184+
&& if let std::path::Prefix::VerbatimDisk(_) = p.kind() {
185+
false
186+
} else {
187+
true
188+
}
183189
}
184190
_ => false,
185191
}

0 commit comments

Comments
 (0)