about summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-02-28 01:55:49 +0100
committerGitHub <noreply@github.com>2020-02-28 01:55:49 +0100
commit02b96b3ecc48dc5245e425fc248163cfaae9643e (patch)
treebad29616a580bcc720dcbedc94715e30ee89ba01 /src/libstd/sys
parent4c9e44fc5f2958706fb747d7ccf4d49f1f384545 (diff)
parent7be94a8a958750cf57c0fa41ad7797a2cd1630de (diff)
downloadrust-02b96b3ecc48dc5245e425fc248163cfaae9643e.tar.gz
rust-02b96b3ecc48dc5245e425fc248163cfaae9643e.zip
Rollup merge of #69529 - matthiaskrgr:clippy_identity_conversion, r=Mark-Simulacrum
don't use .into() to convert types into identical types.

This removes redundant `.into()` calls.

example: `let s: String = format!("hello").into();`
Diffstat (limited to 'src/libstd/sys')
-rw-r--r--src/libstd/sys/unix/process/process_common.rs4
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("=");