Skip to content

Commit

Permalink
Avoid eager unnecessary strin formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Ludvig Liljenberg <lliljenberg@microsoft.com>
  • Loading branch information
ludfjig committed Nov 20, 2024
1 parent f0e4574 commit 41a3fb3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/hyperlight_host/src/mem/elf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ impl ElfInfo {
.copy_from_slice(&self.payload[payload_offset..payload_offset + payload_len]);
target[start_va + payload_len..start_va + phdr.p_memsz as usize].fill(0);
}
let get_addend = |name, r: &Reloc| r.r_addend.ok_or(new_error!("{} missing addend", name));
let get_addend = |name, r: &Reloc| {
r.r_addend
.ok_or_else(|| new_error!("{} missing addend", name))
};
for r in self.relocs.iter() {
#[cfg(target_arch = "aarch64")]
match r.r_type {
Expand All @@ -101,7 +104,7 @@ impl ElfInfo {
}
R_X86_64_NONE => {}
_ => {
log_then_return!("unsupported x86_64 relocation {}", r.r_type);
log_then_return!("unsupported x86_64 relocation");
}
}
}
Expand Down

0 comments on commit 41a3fb3

Please sign in to comment.