File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -215,7 +215,7 @@ static UPDATE_ROOT: &str = "https://static.rust-lang.org/rustup";
215
215
/// substituted for the directory prefix
216
216
fn canonical_cargo_home ( ) -> Result < String > {
217
217
let path = utils:: cargo_home ( ) ?;
218
- let mut path_str = path. to_string_lossy ( ) . to_string ( ) ;
218
+ let mut path_str = path. to_string_lossy ( ) . into_owned ( ) ;
219
219
220
220
let default_cargo_home = utils:: home_dir ( )
221
221
. unwrap_or_else ( || PathBuf :: from ( "." ) )
@@ -1168,7 +1168,7 @@ fn do_add_to_path(methods: &[PathUpdateMethod]) -> Result<()> {
1168
1168
let mut new_path = utils:: cargo_home ( ) ?
1169
1169
. join ( "bin" )
1170
1170
. to_string_lossy ( )
1171
- . to_string ( ) ;
1171
+ . into_owned ( ) ;
1172
1172
if old_path. contains ( & new_path) {
1173
1173
return Ok ( ( ) ) ;
1174
1174
}
@@ -1283,7 +1283,7 @@ fn do_remove_from_path(methods: &[PathUpdateMethod]) -> Result<()> {
1283
1283
let path_str = utils:: cargo_home ( ) ?
1284
1284
. join ( "bin" )
1285
1285
. to_string_lossy ( )
1286
- . to_string ( ) ;
1286
+ . into_owned ( ) ;
1287
1287
let idx = if let Some ( i) = old_path. find ( & path_str) {
1288
1288
i
1289
1289
} else {
You can’t perform that action at this time.
0 commit comments