diff options
| author | ljedrz <ljedrz@gmail.com> | 2018-10-06 11:49:03 +0200 |
|---|---|---|
| committer | ljedrz <ljedrz@gmail.com> | 2018-11-10 19:25:22 +0100 |
| commit | 3dbb2cc864db144154a5f4c349bcbc017533ee07 (patch) | |
| tree | b5448c1c4f2e3ba8dc37d3cb270759f5bbcf63a5 /src/librustc_codegen_llvm/back/archive.rs | |
| parent | 4286c3c1b0a4eb508483c915120a875966ac27c9 (diff) | |
| download | rust-3dbb2cc864db144154a5f4c349bcbc017533ee07.tar.gz rust-3dbb2cc864db144154a5f4c349bcbc017533ee07.zip | |
codegen_llvm_back: improve common patterns
Diffstat (limited to 'src/librustc_codegen_llvm/back/archive.rs')
| -rw-r--r-- | src/librustc_codegen_llvm/back/archive.rs | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/librustc_codegen_llvm/back/archive.rs b/src/librustc_codegen_llvm/back/archive.rs index 9f884a0cbe5..daddae42db2 100644 --- a/src/librustc_codegen_llvm/back/archive.rs +++ b/src/librustc_codegen_llvm/back/archive.rs @@ -185,13 +185,8 @@ impl<'a> ArchiveBuilder<'a> { /// Combine the provided files, rlibs, and native libraries into a single /// `Archive`. pub fn build(&mut self) { - let kind = match self.llvm_archive_kind() { - Ok(kind) => kind, - Err(kind) => { - self.config.sess.fatal(&format!("Don't know how to build archive of type: {}", - kind)); - } - }; + let kind = self.llvm_archive_kind().unwrap_or_else(|kind| + self.config.sess.fatal(&format!("Don't know how to build archive of type: {}", kind))); if let Err(e) = self.build_with_llvm(kind) { self.config.sess.fatal(&format!("failed to build archive: {}", e)); |
