From cd8973250dff50a2b71641659baa36c70ab3d57e Mon Sep 17 00:00:00 2001 From: LingMan Date: Mon, 23 Nov 2020 04:58:21 +0100 Subject: Use Option::map instead of open coding it --- compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'compiler/rustc_codegen_llvm/src') diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs index 5e8ff14f0aa..96484034da7 100644 --- a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs +++ b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs @@ -1152,10 +1152,7 @@ impl<'ll> MemberDescription<'ll> { self.size.bits(), self.align.bits() as u32, self.offset.bits(), - match self.discriminant { - None => None, - Some(value) => Some(cx.const_u64(value)), - }, + self.discriminant.map(|v| cx.const_u64(v)), self.flags, self.type_metadata, ) -- cgit 1.4.1-3-g733a5