Skip to content

Commit ba4afa9

Browse files
committed
Fixed clippy lints
1 parent 2fb8283 commit ba4afa9

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

libcamera-meta/src/bin/generate_from_git.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ fn main() {
3838
if let Some(mut remote) = repo.remotes().ok().and_then(|remote_names| {
3939
remote_names
4040
.iter()
41-
.filter_map(|r| r)
41+
.flatten()
4242
.filter_map(|name| repo.find_remote(name).ok())
4343
.next()
4444
}) {
@@ -120,7 +120,7 @@ fn main() {
120120
fn parse_control_files(files: &BTreeMap<String, String>) -> Vec<Control> {
121121
let control_yamls = files
122122
.iter()
123-
.flat_map(|(_, contents)| YamlLoader::load_from_str(&contents).unwrap());
123+
.flat_map(|(_, contents)| YamlLoader::load_from_str(contents).unwrap());
124124

125125
let mut controls = Vec::new();
126126

@@ -188,7 +188,7 @@ fn main() {
188188
std::fs::create_dir_all(output_dir.as_path()).unwrap();
189189

190190
for (name, contents) in data.controls.iter().chain(data.properties.iter()) {
191-
std::fs::write(output_dir.join(&name), &contents).unwrap();
191+
std::fs::write(output_dir.join(name), contents).unwrap();
192192
}
193193

194194
println!("Parsing controls for version {version}");
@@ -436,9 +436,7 @@ mod generate_rust {
436436
"#;
437437

438438
let file = format!("{header}\n{}", generate_controls(controls, ty));
439-
let file = prettyplease::unparse(&syn::parse_file(&file).unwrap());
440-
441-
file
439+
prettyplease::unparse(&syn::parse_file(&file).unwrap())
442440
}
443441
}
444442

libcamera-sys/build.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ fn main() {
1616

1717
let libcamera_include_path = libcamera
1818
.include_paths
19-
.get(0)
19+
.first()
2020
.expect("Unable to get libcamera include path");
2121

2222
println!("cargo:rustc-link-lib=camera");

0 commit comments

Comments
 (0)