From 003670748f88d22e19b449db4e24b35739b9e984 Mon Sep 17 00:00:00 2001 From: est31 Date: Wed, 17 Feb 2021 10:46:35 +0100 Subject: [PATCH] Remove redundant to_string calls --- compiler/rustc_codegen_llvm/src/allocator.rs | 2 +- compiler/rustc_codegen_ssa/src/back/link.rs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/compiler/rustc_codegen_llvm/src/allocator.rs b/compiler/rustc_codegen_llvm/src/allocator.rs index a5ea0b2a74c..068e5e99efe 100644 --- a/compiler/rustc_codegen_llvm/src/allocator.rs +++ b/compiler/rustc_codegen_llvm/src/allocator.rs @@ -93,7 +93,7 @@ pub(crate) unsafe fn codegen( let args = [usize, usize]; // size, align let ty = llvm::LLVMFunctionType(void, args.as_ptr(), args.len() as c_uint, False); - let name = "__rust_alloc_error_handler".to_string(); + let name = "__rust_alloc_error_handler"; let llfn = llvm::LLVMRustGetOrInsertFunction(llmod, name.as_ptr().cast(), name.len(), ty); // -> ! DIFlagNoReturn llvm::Attribute::NoReturn.apply_llfn(llvm::AttributePlace::Function, llfn); diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs index 6c58417590e..67ee4b9fb7a 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs @@ -178,16 +178,16 @@ fn get_linker( let original_path = tool.path(); if let Some(ref root_lib_path) = original_path.ancestors().nth(4) { let arch = match t.arch.as_str() { - "x86_64" => Some("x64".to_string()), - "x86" => Some("x86".to_string()), - "aarch64" => Some("arm64".to_string()), - "arm" => Some("arm".to_string()), + "x86_64" => Some("x64"), + "x86" => Some("x86"), + "aarch64" => Some("arm64"), + "arm" => Some("arm"), _ => None, }; if let Some(ref a) = arch { // FIXME: Move this to `fn linker_with_args`. let mut arg = OsString::from("/LIBPATH:"); - arg.push(format!("{}\\lib\\{}\\store", root_lib_path.display(), a.to_string())); + arg.push(format!("{}\\lib\\{}\\store", root_lib_path.display(), a)); cmd.arg(&arg); } else { warn!("arch is not supported");