From b7250f45e5dd1b0f671dfe124ec0360cfd9e70be Mon Sep 17 00:00:00 2001 From: Gwilym Inzani Date: Wed, 2 Oct 2024 16:56:12 +0100 Subject: [PATCH] Don't use ok_or_else for a copy value --- agb-debug/src/load_dwarf.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agb-debug/src/load_dwarf.rs b/agb-debug/src/load_dwarf.rs index 4f81bdb20..43e0955c0 100644 --- a/agb-debug/src/load_dwarf.rs +++ b/agb-debug/src/load_dwarf.rs @@ -27,7 +27,7 @@ pub fn load_dwarf(file_content: &[u8]) -> Result { 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];