Skip to content

Commit 8545d99

Browse files
committed
Do not deconstruct an error to rebuild it right after
1 parent 49ee1e9 commit 8545d99

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
@@ -208,9 +208,7 @@ pub fn glob_with(pattern: &str, options: MatchOptions) -> Result<Paths, PatternE
208208
}
209209

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

215213
let mut components = Path::new(pattern).components().peekable();
216214
loop {

0 commit comments

Comments
 (0)