File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -88,8 +88,7 @@ impl PatternFilter {
8888 /// Walkers commonly yield absolute paths, while CLI patterns are normally
8989 /// project-relative (`node_modules`, `src/**`, `*.test.js`).
9090 fn matches_glob ( globs : & GlobSet , path : & Path ) -> bool {
91- globs. is_match ( path)
92- || Self :: path_suffixes ( path) . any ( |candidate| globs. is_match ( candidate) )
91+ globs. is_match ( path) || Self :: path_suffixes ( path) . any ( |candidate| globs. is_match ( candidate) )
9392 }
9493
9594 fn path_suffixes ( path : & Path ) -> impl Iterator < Item = PathBuf > + ' _ {
Original file line number Diff line number Diff line change @@ -122,12 +122,8 @@ pub(crate) fn keywords_pattern(keywords: &[String]) -> Option<String> {
122122 . map ( String :: as_str)
123123 . filter ( |keyword| !keyword. is_empty ( ) )
124124 . collect ( ) ;
125- keywords. sort_unstable_by ( |left, right| {
126- right
127- . len ( )
128- . cmp ( & left. len ( ) )
129- . then_with ( || left. cmp ( right) )
130- } ) ;
125+ keywords
126+ . sort_unstable_by ( |left, right| right. len ( ) . cmp ( & left. len ( ) ) . then_with ( || left. cmp ( right) ) ) ;
131127 keywords. dedup ( ) ;
132128 if keywords. is_empty ( ) {
133129 return None ;
@@ -239,11 +235,7 @@ mod tests {
239235
240236 #[ test]
241237 fn test_complexity_keywords_match_symbols_and_identifier_boundaries ( ) {
242- let keywords = vec ! [
243- "?" . to_string( ) ,
244- "??" . to_string( ) ,
245- "if" . to_string( ) ,
246- ] ;
238+ let keywords = vec ! [ "?" . to_string( ) , "??" . to_string( ) , "if" . to_string( ) ] ;
247239 let pattern = keywords_pattern ( & keywords) . unwrap ( ) ;
248240 let regex = Regex :: new ( & pattern) . unwrap ( ) ;
249241 let matches: Vec < _ > = regex
You can’t perform that action at this time.
0 commit comments