Skip to content

Commit 21962b9

Browse files
committed
Do not deconstruct an error to rebuild it right after
1 parent 7b29204 commit 21962b9

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,7 @@ pub fn glob_with(pattern: &str, options: MatchOptions) -> Result<Paths, PatternE
206206
}
207207

208208
// make sure that the pattern is valid first, else early return with error
209-
if let Err(err) = Pattern::new(pattern) {
210-
return Err(err);
211-
}
209+
let _ = Pattern::new(pattern)?;
212210

213211
let mut components = Path::new(pattern).components().peekable();
214212
loop {

0 commit comments

Comments
 (0)