Skip to content

Commit e5eb538

Browse files
committed
rustc/session: use to_owned when no string conversion is needed
1 parent 0b2e9f7 commit e5eb538

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustc/session/config.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2157,7 +2157,7 @@ pub fn build_session_options_and_crate_config(
21572157
let mut name_parts = name.splitn(2, ':');
21582158
let name = name_parts.next().unwrap();
21592159
let new_name = name_parts.next();
2160-
(name.to_string(), new_name.map(|n| n.to_string()), kind)
2160+
(name.to_owned(), new_name.map(|n| n.to_owned()), kind)
21612161
})
21622162
.collect();
21632163

@@ -2223,7 +2223,7 @@ pub fn build_session_options_and_crate_config(
22232223
};
22242224

22252225
externs
2226-
.entry(name.to_string())
2226+
.entry(name.to_owned())
22272227
.or_default()
22282228
.insert(location);
22292229
}

0 commit comments

Comments
 (0)