From 07168f9cdcaae65550ea04395bef1258e8bbe9c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Wed, 4 Mar 2020 13:36:49 +0100 Subject: [PATCH] Don't use .ok() before unwrapping via .expect() on a Result. The Result can be expect-unwrapped directly. (clippy::ok_expect) --- src/librustc_codegen_llvm/context.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/librustc_codegen_llvm/context.rs b/src/librustc_codegen_llvm/context.rs index 46f461b98c8d..3466363ac797 100644 --- a/src/librustc_codegen_llvm/context.rs +++ b/src/librustc_codegen_llvm/context.rs @@ -174,7 +174,6 @@ pub unsafe fn create_module( let llvm_data_layout = llvm::LLVMGetDataLayout(llmod); let llvm_data_layout = str::from_utf8(CStr::from_ptr(llvm_data_layout).to_bytes()) - .ok() .expect("got a non-UTF8 data-layout from LLVM"); // Unfortunately LLVM target specs change over time, and right now we