Skip to content

Commit 61fceb6

Browse files
committed
simplify code a bit
1 parent 5378936 commit 61fceb6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -651,8 +651,8 @@ pub fn file_metadata<'ll>(cx: &CodegenCx<'ll, '_>, source_file: &SourceFile) ->
651651
hash_kind,
652652
hash_value.as_ptr().cast(),
653653
hash_value.len(),
654-
source.map(|x| x.as_ptr().cast()).unwrap_or(ptr::null()),
655-
source.map(|x| x.len()).unwrap_or(0),
654+
source.map_or(ptr::null(), |x| x.as_ptr().cast()),
655+
source.map_or(0, |x| x.len()),
656656
)
657657
}
658658
}

0 commit comments

Comments
 (0)