Skip to content

Commit

Permalink
Don't use ok_or_else for a copy value (#778)
Browse files Browse the repository at this point in the history
Needed to fix today's clippy linting error

- [x]  no changelog update needed
  • Loading branch information
gwilymk authored Oct 2, 2024
2 parents 93dabdb + b7250f4 commit bfe3a02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion agb-debug/src/load_dwarf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub fn load_dwarf(file_content: &[u8]) -> Result<GimliDwarf, LoadDwarfError> {
let last_non_zero_byte = file_content
.iter()
.rposition(|&b| b != 0)
.ok_or_else(|| LoadDwarfError::GbaFileEmpty)?;
.ok_or(LoadDwarfError::GbaFileEmpty)?;

let file_content = &file_content[..last_non_zero_byte + 1];

Expand Down

0 comments on commit bfe3a02

Please sign in to comment.