5555 "Eventually this command will be a true alias. Until then:" ,
5656 ) ) ;
5757 ( cfg. notify_handler ) ( Notification :: PlainVerboseMessage ( & format ! (
58- " Please use `rustup {}` instead" ,
59- instead
58+ " Please use `rustup {instead}` instead"
6059 ) ) ) ;
6160 callee ( cfg, matches)
6261}
@@ -72,15 +71,15 @@ pub fn main() -> Result<utils::ExitCode> {
7271 message,
7372 ..
7473 } ) => {
75- writeln ! ( process( ) . stdout( ) . lock( ) , "{}" , message ) ?;
74+ writeln ! ( process( ) . stdout( ) . lock( ) , "{message}" ) ?;
7675 return Ok ( utils:: ExitCode ( 0 ) ) ;
7776 }
7877 Err ( clap:: Error {
7978 kind : VersionDisplayed ,
8079 message,
8180 ..
8281 } ) => {
83- writeln ! ( process( ) . stdout( ) . lock( ) , "{}" , message ) ?;
82+ writeln ! ( process( ) . stdout( ) . lock( ) , "{message}" ) ?;
8483 info ! ( "This is the version for the rustup toolchain manager, not the rustc compiler." ) ;
8584
8685 fn rustc_version ( ) -> std:: result:: Result < String , Box < dyn std:: error:: Error > > {
@@ -114,7 +113,7 @@ pub fn main() -> Result<utils::ExitCode> {
114113 ]
115114 . contains ( kind)
116115 {
117- writeln ! ( process( ) . stdout( ) . lock( ) , "{}" , message ) ?;
116+ writeln ! ( process( ) . stdout( ) . lock( ) , "{message}" ) ?;
118117 return Ok ( utils:: ExitCode ( 1 ) ) ;
119118 }
120119 }
@@ -815,7 +814,7 @@ fn update_bare_triple_check(cfg: &Cfg, name: &str) -> Result<()> {
815814 "\n you may use one of the following toolchains:"
816815 ) ?;
817816 for n in & candidates {
818- writeln ! ( process( ) . stdout( ) , "{}" , n ) ?;
817+ writeln ! ( process( ) . stdout( ) , "{n}" ) ?;
819818 }
820819 writeln ! ( process( ) . stdout( ) , ) ?;
821820 }
@@ -832,7 +831,7 @@ fn default_bare_triple_check(cfg: &Cfg, name: &str) -> Result<()> {
832831 let default_name = default. map ( |t| t. name ( ) . to_string ( ) ) . unwrap_or_default ( ) ;
833832 if let Ok ( mut desc) = PartialToolchainDesc :: from_str ( & default_name) {
834833 desc. target = triple;
835- let maybe_toolchain = format ! ( "{}" , desc ) ;
834+ let maybe_toolchain = format ! ( "{desc}" ) ;
836835 let toolchain = cfg. get_toolchain ( maybe_toolchain. as_ref ( ) , false ) ?;
837836 if toolchain. name ( ) == default_name {
838837 warn ! (
@@ -903,7 +902,7 @@ fn check_updates(cfg: &Cfg) -> Result<utils::ExitCode> {
903902 let current_version = distributable. show_version ( ) ?;
904903 let dist_version = distributable. show_dist_version ( ) ?;
905904 let _ = t. attr ( term2:: Attr :: Bold ) ;
906- write ! ( t, "{} - " , name ) ?;
905+ write ! ( t, "{name } - " ) ?;
907906 match ( current_version, dist_version) {
908907 ( None , None ) => {
909908 let _ = t. fg ( term2:: color:: RED ) ;
@@ -913,19 +912,19 @@ fn check_updates(cfg: &Cfg) -> Result<utils::ExitCode> {
913912 let _ = t. fg ( term2:: color:: GREEN ) ;
914913 write ! ( t, "Up to date" ) ?;
915914 let _ = t. reset ( ) ;
916- writeln ! ( t, " : {}" , cv ) ?;
915+ writeln ! ( t, " : {cv}" ) ?;
917916 }
918917 ( Some ( cv) , Some ( dv) ) => {
919918 let _ = t. fg ( term2:: color:: YELLOW ) ;
920919 write ! ( t, "Update available" ) ?;
921920 let _ = t. reset ( ) ;
922- writeln ! ( t, " : {} -> {}" , cv , dv ) ?;
921+ writeln ! ( t, " : {cv } -> {dv}" ) ?;
923922 }
924923 ( None , Some ( dv) ) => {
925924 let _ = t. fg ( term2:: color:: YELLOW ) ;
926925 write ! ( t, "Update available" ) ?;
927926 let _ = t. reset ( ) ;
928- writeln ! ( t, " : (Unknown version) -> {}" , dv ) ?;
927+ writeln ! ( t, " : (Unknown version) -> {dv}" ) ?;
929928 }
930929 }
931930 }
@@ -1141,9 +1140,9 @@ fn show(cfg: &Cfg, m: &ArgMatches<'_>) -> Result<utils::ExitCode> {
11411140 let default_name = default_name?;
11421141 for it in installed_toolchains {
11431142 if default_name == it {
1144- writeln ! ( t, "{} (default)" , it ) ?;
1143+ writeln ! ( t, "{it } (default)" ) ?;
11451144 } else {
1146- writeln ! ( t, "{}" , it ) ?;
1145+ writeln ! ( t, "{it}" ) ?;
11471146 }
11481147 if verbose {
11491148 if let Ok ( toolchain) = cfg. get_toolchain ( & it, false ) {
@@ -1203,9 +1202,9 @@ fn show(cfg: &Cfg, m: &ArgMatches<'_>) -> Result<utils::ExitCode> {
12031202 {
12041203 writeln ! ( t, "no active toolchain" ) ?;
12051204 } else if let Some ( cause) = err. source ( ) {
1206- writeln ! ( t, "(error: {}, {})" , err , cause ) ?;
1205+ writeln ! ( t, "(error: {err }, {cause })" ) ?;
12071206 } else {
1208- writeln ! ( t, "(error: {})" , err ) ?;
1207+ writeln ! ( t, "(error: {err })" ) ?;
12091208 }
12101209 }
12111210 }
@@ -1220,7 +1219,7 @@ fn show(cfg: &Cfg, m: &ArgMatches<'_>) -> Result<utils::ExitCode> {
12201219 E : From < term:: Error > + From < std:: io:: Error > ,
12211220 {
12221221 t. attr ( term2:: Attr :: Bold ) ?;
1223- writeln ! ( t, "{}" , s ) ?;
1222+ writeln ! ( t, "{s}" ) ?;
12241223 writeln ! ( t, "{}" , "-" . repeat( s. len( ) ) ) ?;
12251224 writeln ! ( t) ?;
12261225 t. reset ( ) ?;
@@ -1665,7 +1664,7 @@ impl FromStr for CompletionCommand {
16651664 let completion_options = COMPLETIONS
16661665 . iter ( )
16671666 . map ( |& ( v, _) | v)
1668- . fold ( "" . to_owned ( ) , |s, v| format ! ( "{}{ }, " , s , v ) ) ;
1667+ . fold ( "" . to_owned ( ) , |s, v| format ! ( "{s}{v }, " ) ) ;
16691668 Err ( format ! (
16701669 "[valid values: {}]" ,
16711670 completion_options. trim_end_matches( ", " )
@@ -1678,7 +1677,7 @@ impl FromStr for CompletionCommand {
16781677impl fmt:: Display for CompletionCommand {
16791678 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
16801679 match COMPLETIONS . iter ( ) . find ( |& ( _, cmd) | cmd == self ) {
1681- Some ( & ( val, _) ) => write ! ( f, "{}" , val ) ,
1680+ Some ( & ( val, _) ) => write ! ( f, "{val}" ) ,
16821681 None => unreachable ! ( ) ,
16831682 }
16841683 }
@@ -1709,9 +1708,8 @@ fn output_completion_script(shell: Shell, command: CompletionCommand) -> Result<
17091708 writeln ! (
17101709 term2:: stdout( ) ,
17111710 "if command -v rustc >/dev/null 2>&1; then\n \
1712- \t source \" $(rustc --print sysroot)\" {}\n \
1711+ \t source \" $(rustc --print sysroot)\" {script }\n \
17131712 fi",
1714- script,
17151713 ) ?;
17161714 }
17171715 }
0 commit comments