diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2020-02-25 18:10:34 +0100 |
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2020-02-27 23:32:46 +0100 |
| commit | 7be94a8a958750cf57c0fa41ad7797a2cd1630de (patch) | |
| tree | c6064989bb4e5f2795af1f71831c2bcf22b6f2c3 /src/libstd | |
| parent | 49c68bd53f90e375bfb3cbba8c1c67a9e0adb9c0 (diff) | |
| download | rust-7be94a8a958750cf57c0fa41ad7797a2cd1630de.tar.gz rust-7be94a8a958750cf57c0fa41ad7797a2cd1630de.zip | |
don't use .into() to convert types into identical types.
example:
let s: String = format!("hello").into();
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/sys/unix/process/process_common.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/libstd/sys/unix/process/process_common.rs b/src/libstd/sys/unix/process/process_common.rs index e66d6fdc56a..83f052c898b 100644 --- a/src/libstd/sys/unix/process/process_common.rs +++ b/src/libstd/sys/unix/process/process_common.rs @@ -287,9 +287,7 @@ impl CStringArray { fn construct_envp(env: BTreeMap<OsString, OsString>, saw_nul: &mut bool) -> CStringArray { let mut result = CStringArray::with_capacity(env.len()); - for (k, v) in env { - let mut k: OsString = k.into(); - + for (mut k, v) in env { // Reserve additional space for '=' and null terminator k.reserve_exact(v.len() + 2); k.push("="); |
