Skip to content

Commit

Permalink
[refactor] fix cargo clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Alignof committed Jan 14, 2025
1 parent a1e81f7 commit 1f79883
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,26 @@ use std::path::PathBuf;
use std::process::Command;

/// Build script for cargo project
#[allow(clippy::similar_names)]
fn main() {
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());

let dts_file = "guest_image/guest.dts";
let dtb_file = "guest.dtb";

let status = Command::new("dtc")
.args(&["-I", "dts", "-O", "dtb", "-o", &dtb_file, dts_file])
.args(["-I", "dts", "-O", "dtb", "-o", dtb_file, dts_file])
.status()
.expect("Failed to execute dtc");

if !status.success() {
panic!("dtc failed with exit status: {}", status);
}
assert!(status.success(), "dtc failed with exit status: {status}");

// Put the linker script somewhere the linker can find it.
fs::write(out_dir.join("memory.x"), include_bytes!("memory.x")).unwrap();
println!("cargo:rustc-link-search={}", out_dir.display());
println!("cargo:rerun-if-changed=memory.x");

println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rerun-if-changed={}", dts_file);
println!("cargo:rerun-if-changed={}", dtb_file);
println!("cargo:rerun-if-changed={dts_file}");
println!("cargo:rerun-if-changed={dtb_file}");
}

0 comments on commit 1f79883

Please sign in to comment.