Skip to content

Commit 6be39dd

Browse files
committed
fix(rfel): use valid section-length fallback
The prior ELF alignment fix passed an integer to `Option::unwrap_or_else`, which expects a zero-argument closure and prevents `rfel` from compiling. Use `unwrap_or` for the eager zero fallback so the total-length calculation type-checks. Refs: #35 Signed-off-by: Zhouqi Jiang <luojia@rustsbi.com>
1 parent 411a407 commit 6be39dd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

rfel/src/cli/elf_to_bin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ fn process_sections(sections: Vec<object::Section>) -> Result<Vec<u8>> {
186186
.iter()
187187
.map(|x| x.address + x.data.len() as u64 - first_address)
188188
.max()
189-
.unwrap_or_else(0);
189+
.unwrap_or(0);
190190
let total_len =
191191
usize::try_from(total_len).map_err(|_| Elf2BinError::SectionSizeOverflow(total_len))?;
192192

0 commit comments

Comments
 (0)