inconsistencies in cargo fmt

running `cargo +nightly fmt -p app-loader` gives you one result.

running `cargo +nightly fmt --check` gives you another result.

manually opening and saving the files causes a result to agree
with the check.
This commit is contained in:
bunnie 2024-01-15 00:59:23 +08:00
parent 00bb37186a
commit 710da30952
2 changed files with 4 additions and 12 deletions

View file

@ -22,10 +22,7 @@ fn main() {
} }
// Put the linker script somewhere the linker can find it // Put the linker script somewhere the linker can find it
fs::File::create(out_dir.join("link.x")) fs::File::create(out_dir.join("link.x")).unwrap().write_all(include_bytes!("link.x")).unwrap();
.unwrap()
.write_all(include_bytes!("link.x"))
.unwrap();
println!("cargo:rustc-link-search={}", out_dir.display()); println!("cargo:rustc-link-search={}", out_dir.display());
println!("cargo:rerun-if-changed=build.rs"); println!("cargo:rerun-if-changed=build.rs");

View file

@ -132,12 +132,7 @@ fn read_elf(memory: Option<&mut xous::MemoryMessage>) -> usize {
let file_size = to_usize(start + 0x10, 4); let file_size = to_usize(start + 0x10, 4);
let mem_size = to_usize(start + 0x14, 4); let mem_size = to_usize(start + 0x14, 4);
let mem_size = mem_size + padding; let mem_size = mem_size + padding;
let mem_size = mem_size let mem_size = mem_size + if mem_size & 0xFFF == 0 { 0 } else { 0x1000 - (mem_size & 0xFFF) };
+ if mem_size & 0xFFF == 0 {
0
} else {
0x1000 - (mem_size & 0xFFF)
};
assert_eq!(0, mem_size & 0xFFF); assert_eq!(0, mem_size & 0xFFF);
assert_eq!(0, (vaddr - padding) & 0xFFF); assert_eq!(0, (vaddr - padding) & 0xFFF);