mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
remove unnecessary heap allocation
This commit is contained in:
parent
2f5df8a94b
commit
9adc6a49aa
@ -367,7 +367,7 @@ impl<'a> LlvmArchiveBuilder<'a> {
|
||||
match addition {
|
||||
Addition::File { path, name_in_archive } => {
|
||||
let path = CString::new(path.to_str().unwrap())?;
|
||||
let name = CString::new(name_in_archive.clone())?;
|
||||
let name = CString::new(name_in_archive.as_bytes())?;
|
||||
members.push(llvm::LLVMRustArchiveMemberNew(
|
||||
path.as_ptr(),
|
||||
name.as_ptr(),
|
||||
|
@ -441,7 +441,7 @@ fn thin_lto(
|
||||
|
||||
for (i, (name, buffer)) in modules.into_iter().enumerate() {
|
||||
info!("local module: {} - {}", i, name);
|
||||
let cname = CString::new(name.clone()).unwrap();
|
||||
let cname = CString::new(name.as_bytes()).unwrap();
|
||||
thin_modules.push(llvm::ThinLTOModule {
|
||||
identifier: cname.as_ptr(),
|
||||
data: buffer.data().as_ptr(),
|
||||
|
Loading…
Reference in New Issue
Block a user