Skip to content

Commit

Permalink
cargo clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
sima committed Nov 22, 2023
1 parent 20c730a commit 55419be
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,11 @@ fn check_version(
Ok(())
}

fn write_cpp_conf_pri(path: &Path,
include_path: &str) -> Result<(), Box<dyn Error>> {
fn write_cpp_conf_pri(path: &Path, include_path: &str) -> Result<(), Box<dyn Error>> {
let mut f = fs::File::create(path)?;

writeln!(&mut f)?;
writeln!(&mut f, "{} {}", include_path, "/usr/local/include")?;
writeln!(&mut f, "INCLUDEPATH = {} /usr/local/include", include_path)?;

Ok(())
}
Expand Down Expand Up @@ -168,13 +167,13 @@ fn main() -> Result<(), Box<dyn Error>> {
}

let include_path = match conf.get("INCLUDEPATH") {
Some(x) =>
x.to_string(),
None =>
String::from("INCLUDEPATH = "),

Some(x) => x.to_string(),
None => String::new(),
};
write_cpp_conf_pri(&cpp_lib_dir.join(Path::new("conf.pri")), include_path.as_str())?;
write_cpp_conf_pri(
&cpp_lib_dir.join(Path::new("conf.pri")),
include_path.as_str(),
)?;

write_postbuild_conf_pri(
&Path::new("target").join(Path::new("postbuild_conf.pri")),
Expand Down

0 comments on commit 55419be

Please sign in to comment.