@@ -127,54 +127,52 @@ impl<'a> InstallOpts<'a> {
127
127
// a toolchain (updating if it's already present) and then if neither of
128
128
// those are true, we have a user who doesn't mind, and already has an
129
129
// install, so we leave their setup alone.
130
- Ok (
131
- if matches ! ( default_toolchain, Some ( MaybeOfficialToolchainName :: None ) ) {
132
- info ! ( "skipping toolchain installation" ) ;
133
- if !components. is_empty ( ) {
134
- warn ! (
135
- "ignoring requested component{}: {}" ,
136
- if components. len( ) == 1 { "" } else { "s" } ,
137
- components. join( ", " )
138
- ) ;
139
- }
140
- if !targets. is_empty ( ) {
141
- warn ! (
142
- "ignoring requested target{}: {}" ,
143
- if targets. len( ) == 1 { "" } else { "s" } ,
144
- targets. join( ", " )
145
- ) ;
146
- }
147
- writeln ! ( process( ) . stdout( ) . lock( ) ) ?;
148
- None
149
- } else if user_specified_something
150
- || ( !no_update_toolchain && cfg. find_default ( ) ?. is_none ( ) )
151
- {
152
- match default_toolchain {
153
- Some ( s) => {
154
- let toolchain_name = match s {
155
- MaybeOfficialToolchainName :: None => unreachable ! ( ) ,
156
- MaybeOfficialToolchainName :: Some ( n) => n,
157
- } ;
158
- Some ( toolchain_name. resolve ( & cfg. get_default_host_triple ( ) ?) ?)
159
- }
160
- None => match cfg. get_default ( ) ? {
161
- // Default is installable
162
- Some ( ToolchainName :: Official ( t) ) => Some ( t) ,
163
- // Default is custom, presumably from a prior install. Do nothing.
164
- Some ( ToolchainName :: Custom ( _) ) => None ,
165
- None => Some (
166
- "stable"
167
- . parse :: < PartialToolchainDesc > ( ) ?
168
- . resolve ( & cfg. get_default_host_triple ( ) ?) ?,
169
- ) ,
170
- } ,
130
+ if matches ! ( default_toolchain, Some ( MaybeOfficialToolchainName :: None ) ) {
131
+ info ! ( "skipping toolchain installation" ) ;
132
+ if !components. is_empty ( ) {
133
+ warn ! (
134
+ "ignoring requested component{}: {}" ,
135
+ if components. len( ) == 1 { "" } else { "s" } ,
136
+ components. join( ", " )
137
+ ) ;
138
+ }
139
+ if !targets. is_empty ( ) {
140
+ warn ! (
141
+ "ignoring requested target{}: {}" ,
142
+ if targets. len( ) == 1 { "" } else { "s" } ,
143
+ targets. join( ", " )
144
+ ) ;
145
+ }
146
+ writeln ! ( process( ) . stdout( ) . lock( ) ) ?;
147
+ Ok ( None )
148
+ } else if user_specified_something
149
+ || ( !no_update_toolchain && cfg. find_default ( ) ?. is_none ( ) )
150
+ {
151
+ Ok ( match default_toolchain {
152
+ Some ( s) => {
153
+ let toolchain_name = match s {
154
+ MaybeOfficialToolchainName :: None => unreachable ! ( ) ,
155
+ MaybeOfficialToolchainName :: Some ( n) => n,
156
+ } ;
157
+ Some ( toolchain_name. resolve ( & cfg. get_default_host_triple ( ) ?) ?)
171
158
}
172
- } else {
173
- info ! ( "updating existing rustup installation - leaving toolchains alone" ) ;
174
- writeln ! ( process( ) . stdout( ) . lock( ) ) ?;
175
- None
176
- } ,
177
- )
159
+ None => match cfg. get_default ( ) ? {
160
+ // Default is installable
161
+ Some ( ToolchainName :: Official ( t) ) => Some ( t) ,
162
+ // Default is custom, presumably from a prior install. Do nothing.
163
+ Some ( ToolchainName :: Custom ( _) ) => None ,
164
+ None => Some (
165
+ "stable"
166
+ . parse :: < PartialToolchainDesc > ( ) ?
167
+ . resolve ( & cfg. get_default_host_triple ( ) ?) ?,
168
+ ) ,
169
+ } ,
170
+ } )
171
+ } else {
172
+ info ! ( "updating existing rustup installation - leaving toolchains alone" ) ;
173
+ writeln ! ( process( ) . stdout( ) . lock( ) ) ?;
174
+ Ok ( None )
175
+ }
178
176
}
179
177
180
178
// Interactive editing of the install options
0 commit comments