File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ serde_json = { version = "1.0", features = ["preserve_order"] }
38
38
anyhow = " 1.0.65"
39
39
thiserror = " 1.0.35"
40
40
linked-hash-map = " 0.5"
41
- globset = " 0.4.8 "
41
+ globset = " 0.4.14 "
42
42
commands = " 0.0.5"
43
43
env_logger = " 0.10"
44
44
log = { version = " ~0.4" , features = [" std" ] }
Original file line number Diff line number Diff line change 1
1
pub mod patch_cli;
2
2
3
- use globset:: Glob ;
4
3
use std:: fs:: File ;
5
4
use std:: io:: { Read , Write } ;
6
5
use std:: path:: { Path , PathBuf } ;
@@ -248,19 +247,23 @@ fn matchname(name: &str, spec: &str) -> bool {
248
247
matchsubspec ( name, spec) . is_some ( )
249
248
}
250
249
250
+ fn newglob ( spec : & str ) -> globset:: GlobMatcher {
251
+ globset:: Glob :: new ( spec) . unwrap ( ) . compile_matcher ( )
252
+ }
253
+
251
254
/// If a name matches a specification, return the first sub-specification that it matches
252
255
fn matchsubspec < ' a > ( name : & str , spec : & ' a str ) -> Option < & ' a str > {
253
256
if spec. starts_with ( '_' ) {
254
257
return None ;
255
258
}
256
259
if spec. contains ( '{' ) {
257
- let glob = Glob :: new ( spec) . unwrap ( ) . compile_matcher ( ) ;
260
+ let glob = newglob ( spec) ;
258
261
if glob. is_match ( name) {
259
262
return Some ( spec) ;
260
263
}
261
264
} else {
262
265
for subspec in spec. split ( ',' ) {
263
- let glob = Glob :: new ( subspec) . unwrap ( ) . compile_matcher ( ) ;
266
+ let glob = newglob ( subspec) ;
264
267
if glob. is_match ( name) {
265
268
return Some ( subspec) ;
266
269
}
You can’t perform that action at this time.
0 commit comments