about summary refs log tree commit diff
path: root/src/librustc_codegen_utils
diff options
context:
space:
mode:
authorljedrz <ljedrz@gmail.com>2018-10-12 16:16:00 +0200
committerljedrz <ljedrz@gmail.com>2018-10-19 09:45:45 +0200
commitd28aed6dc45ffccc790469cb04f3f775ddb2283a (patch)
treec1a3c356ba1ffc8173746e03f0f630ae4032624f /src/librustc_codegen_utils
parentcb5e1b93e300cf9772a24c6de27d9f21cdae3123 (diff)
downloadrust-d28aed6dc45ffccc790469cb04f3f775ddb2283a.tar.gz
rust-d28aed6dc45ffccc790469cb04f3f775ddb2283a.zip
Prefer unwrap_or_else to unwrap_or in case of function calls/allocations
Diffstat (limited to 'src/librustc_codegen_utils')
-rw-r--r--src/librustc_codegen_utils/link.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustc_codegen_utils/link.rs b/src/librustc_codegen_utils/link.rs
index 3d47f91a623..2a1fbe6ace5 100644
--- a/src/librustc_codegen_utils/link.rs
+++ b/src/librustc_codegen_utils/link.rs
@@ -103,7 +103,7 @@ pub fn filename_for_metadata(sess: &Session,
     let libname = format!("{}{}", crate_name, sess.opts.cg.extra_filename);
 
     let out_filename = outputs.single_output_file.clone()
-        .unwrap_or(outputs.out_directory.join(&format!("lib{}.rmeta", libname)));
+        .unwrap_or_else(|| outputs.out_directory.join(&format!("lib{}.rmeta", libname)));
 
     check_file_is_writeable(&out_filename, sess);