]> git.lizzy.rs Git - rust.git/commitdiff
rustc/session: use to_owned when no string conversion is needed
authorljedrz <ljedrz@gmail.com>
Wed, 10 Oct 2018 13:34:07 +0000 (15:34 +0200)
committerljedrz <ljedrz@gmail.com>
Mon, 15 Oct 2018 08:19:16 +0000 (10:19 +0200)
src/librustc/session/config.rs

index 1498004e66caa423124808fa57bedb08f9262eb4..569e7a24d2353ce8652d5112b6f3738b109c5023 100644 (file)
@@ -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);
     }