about summary refs log tree commit diff
diff options
context:
space:
mode:
authorljedrz <ljedrz@gmail.com>2018-10-10 15:34:07 +0200
committerljedrz <ljedrz@gmail.com>2018-10-15 10:19:16 +0200
commite5eb5385630a22b8d0e6d08fe88ce171f96c79d3 (patch)
tree05c0669edbc8dc0bc5cc7839188df312aff1d67b
parent0b2e9f762a4dfe707b8eb7f48fa8430544bac87e (diff)
downloadrust-e5eb5385630a22b8d0e6d08fe88ce171f96c79d3.tar.gz
rust-e5eb5385630a22b8d0e6d08fe88ce171f96c79d3.zip
rustc/session: use to_owned when no string conversion is needed
-rw-r--r--src/librustc/session/config.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs
index 1498004e66c..569e7a24d23 100644
--- a/src/librustc/session/config.rs
+++ b/src/librustc/session/config.rs
@@ -2157,7 +2157,7 @@ pub fn build_session_options_and_crate_config(
             let mut name_parts = name.splitn(2, ':');
             let name = name_parts.next().unwrap();
             let new_name = name_parts.next();
-            (name.to_string(), new_name.map(|n| n.to_string()), kind)
+            (name.to_owned(), new_name.map(|n| n.to_owned()), kind)
         })
         .collect();
 
@@ -2223,7 +2223,7 @@ pub fn build_session_options_and_crate_config(
         };
 
         externs
-            .entry(name.to_string())
+            .entry(name.to_owned())
             .or_default()
             .insert(location);
     }