File tree Expand file tree Collapse file tree 3 files changed +11
-12
lines changed
Expand file tree Collapse file tree 3 files changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ fn files_with_predicate<'p>(
8888 . filter_map ( |e| {
8989 let path = e. path ( ) ;
9090 // Use path.metadata() instead of e.file_type() to follow symlinks
91- path. metadata ( ) . is_ok_and ( |m| m. is_file ( ) ) . then ( || path)
91+ path. metadata ( ) . is_ok_and ( |m| m. is_file ( ) ) . then_some ( path)
9292 } )
9393 . filter ( move |p| predicate ( p) ) )
9494}
Original file line number Diff line number Diff line change @@ -95,17 +95,15 @@ impl<'r> CmakeProbe<'r> {
9595 if bytes_read == 0 {
9696 break ;
9797 }
98- if line. starts_with ( "OCVRS" ) {
99- if let Some ( ( name, value) ) = line. split_once ( ':' ) {
100- match name {
101- "OCVRS_INCLUDE_DIRS" => {
102- opencv_include_paths. extend ( value. split ( ';' ) . filter ( |s| !s. is_empty ( ) ) . map ( |s| PathBuf :: from ( s. trim ( ) ) ) ) ;
103- }
104- "OCVRS_VERSION" => {
105- * version = Some ( Version :: parse ( value. trim ( ) ) ?) ;
106- }
107- _ => { }
98+ if let Some ( ( key, value) ) = line. strip_prefix ( "OCVRS_" ) . and_then ( |kv| kv. split_once ( ':' ) ) {
99+ match key {
100+ "INCLUDE_DIRS" => {
101+ opencv_include_paths. extend ( value. split ( ';' ) . filter ( |s| !s. is_empty ( ) ) . map ( |s| PathBuf :: from ( s. trim ( ) ) ) ) ;
102+ }
103+ "VERSION" => {
104+ * version = Some ( Version :: parse ( value. trim ( ) ) ?) ;
108105 }
106+ _ => { }
109107 }
110108 }
111109 line. clear ( ) ;
Original file line number Diff line number Diff line change 11#[ expect(
2+ clippy:: approx_constant,
23 clippy:: doc_lazy_continuation,
34 clippy:: doc_overindented_list_items,
45 clippy:: double_must_use,
910 clippy:: should_implement_trait,
1011 clippy:: tabs_in_doc_comments,
1112 clippy:: too_many_arguments,
13+ clippy:: type_complexity,
1214 clippy:: unused_unit,
13- clippy:: approx_constant,
1415 dead_code,
1516 non_camel_case_types,
1617 non_snake_case,
You can’t perform that action at this time.
0 commit comments