@@ -30,7 +30,7 @@ use crate::{Config, CommandTemplate};
30
30
31
31
pub type GitDate = Date < Utc > ;
32
32
33
- const YYYY_MM_DD : & ' static str = "%Y-%m-%d" ;
33
+ const YYYY_MM_DD : & str = "%Y-%m-%d" ;
34
34
35
35
pub ( crate ) const NIGHTLY_SERVER : & str = "https://static.rust-lang.org/dist" ;
36
36
const CI_SERVER : & str = "https://s3-us-west-1.amazonaws.com/rust-lang-ci2" ;
@@ -70,7 +70,7 @@ impl fmt::Display for Toolchain {
70
70
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
71
71
match self . spec {
72
72
ToolchainSpec :: Ci { ref commit, alt } => {
73
- let alt_s = if alt { format ! ( "-alt" ) } else { String :: new ( ) } ;
73
+ let alt_s = if alt { "-alt" . to_string ( ) } else { String :: new ( ) } ;
74
74
write ! ( f, "{}{}" , commit, alt_s)
75
75
}
76
76
ToolchainSpec :: Nightly { ref date } => write ! ( f, "nightly-{}" , date. format( YYYY_MM_DD ) ) ,
@@ -82,7 +82,7 @@ impl Toolchain {
82
82
pub ( crate ) fn rustup_name ( & self ) -> String {
83
83
match self . spec {
84
84
ToolchainSpec :: Ci { ref commit, alt } => {
85
- let alt_s = if alt { format ! ( "-alt" ) } else { String :: new ( ) } ;
85
+ let alt_s = if alt { "-alt" . to_string ( ) } else { String :: new ( ) } ;
86
86
format ! ( "bisector-ci-{}{}-{}" , commit, alt_s, self . host)
87
87
}
88
88
// N.B. We need to call this with a nonstandard name so that rustup utilizes the
@@ -152,7 +152,7 @@ impl Toolchain {
152
152
let cmd = CommandTemplate :: new (
153
153
[ "rustc" , "--print" , "sysroot" ]
154
154
. iter ( )
155
- . map ( |s| s . to_string ( ) ) ,
155
+ . map ( |s| ( * s ) . to_string ( ) ) ,
156
156
) ;
157
157
let stdout = cmd. output ( ) ?. stdout ;
158
158
let output = String :: from_utf8_lossy ( & stdout) ;
@@ -166,7 +166,7 @@ impl Toolchain {
166
166
let cmd = CommandTemplate :: new (
167
167
[ "rustup" , "toolchain" , "link" ]
168
168
. iter ( )
169
- . map ( |s| s . to_string ( ) )
169
+ . map ( |s| ( * s ) . to_string ( ) )
170
170
. chain ( iter:: once ( self . rustup_name ( ) ) )
171
171
. chain ( iter:: once ( nightly_path) ) ,
172
172
) ;
@@ -203,7 +203,7 @@ impl Toolchain {
203
203
match e {
204
204
DownloadError :: NotFound ( url) => {
205
205
return Err ( InstallError :: NotFound {
206
- url : url ,
206
+ url,
207
207
spec : self . spec . clone ( ) ,
208
208
} )
209
209
}
@@ -390,7 +390,7 @@ impl fmt::Display for ToolchainSpec {
390
390
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
391
391
match * self {
392
392
ToolchainSpec :: Ci { ref commit, alt } => {
393
- let alt_s = if alt { format ! ( "-alt" ) } else { String :: new ( ) } ;
393
+ let alt_s = if alt { "-alt" . to_string ( ) } else { String :: new ( ) } ;
394
394
write ! ( f, "{}{}" , commit, alt_s)
395
395
}
396
396
ToolchainSpec :: Nightly { ref date } => write ! ( f, "nightly-{}" , date) ,
@@ -425,7 +425,7 @@ impl DownloadParams {
425
425
426
426
pub ( crate ) fn from_cfg_with_url_prefix ( cfg : & Config , url_prefix : String ) -> Self {
427
427
DownloadParams {
428
- url_prefix : url_prefix ,
428
+ url_prefix,
429
429
tmp_dir : cfg. rustup_tmp_path . clone ( ) ,
430
430
install_dir : cfg. toolchains_path . clone ( ) ,
431
431
install_cargo : cfg. args . with_cargo ,
0 commit comments