Skip to content

Commit 8af2673

Browse files
committed
Cleanup
1 parent b870c17 commit 8af2673

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

build/cmake_probe.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff 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();

src/opencv.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#[expect(
2+
clippy::approx_constant,
23
clippy::doc_lazy_continuation,
34
clippy::doc_overindented_list_items,
45
clippy::double_must_use,
@@ -9,8 +10,8 @@
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,

0 commit comments

Comments
 (0)