Skip to content

Commit 0036707

Browse files
committed
Remove redundant to_string calls
1 parent 42a4673 commit 0036707

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

compiler/rustc_codegen_llvm/src/allocator.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ pub(crate) unsafe fn codegen(
9393
let args = [usize, usize]; // size, align
9494

9595
let ty = llvm::LLVMFunctionType(void, args.as_ptr(), args.len() as c_uint, False);
96-
let name = "__rust_alloc_error_handler".to_string();
96+
let name = "__rust_alloc_error_handler";
9797
let llfn = llvm::LLVMRustGetOrInsertFunction(llmod, name.as_ptr().cast(), name.len(), ty);
9898
// -> ! DIFlagNoReturn
9999
llvm::Attribute::NoReturn.apply_llfn(llvm::AttributePlace::Function, llfn);

compiler/rustc_codegen_ssa/src/back/link.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -178,16 +178,16 @@ fn get_linker(
178178
let original_path = tool.path();
179179
if let Some(ref root_lib_path) = original_path.ancestors().nth(4) {
180180
let arch = match t.arch.as_str() {
181-
"x86_64" => Some("x64".to_string()),
182-
"x86" => Some("x86".to_string()),
183-
"aarch64" => Some("arm64".to_string()),
184-
"arm" => Some("arm".to_string()),
181+
"x86_64" => Some("x64"),
182+
"x86" => Some("x86"),
183+
"aarch64" => Some("arm64"),
184+
"arm" => Some("arm"),
185185
_ => None,
186186
};
187187
if let Some(ref a) = arch {
188188
// FIXME: Move this to `fn linker_with_args`.
189189
let mut arg = OsString::from("/LIBPATH:");
190-
arg.push(format!("{}\\lib\\{}\\store", root_lib_path.display(), a.to_string()));
190+
arg.push(format!("{}\\lib\\{}\\store", root_lib_path.display(), a));
191191
cmd.arg(&arg);
192192
} else {
193193
warn!("arch is not supported");

0 commit comments

Comments
 (0)