@@ -232,11 +232,11 @@ impl Shell {
232
232
/// Updates the color choice (always, never, or auto) from a string..
233
233
pub fn set_color_choice ( & mut self , color : Option < & str > ) -> CargoResult < ( ) > {
234
234
if let ShellOut :: Stream {
235
- ref mut stdout,
236
- ref mut stderr,
237
- ref mut color_choice,
235
+ stdout,
236
+ stderr,
237
+ color_choice,
238
238
..
239
- } = self . output
239
+ } = & mut self . output
240
240
{
241
241
let cfg = color
242
242
. map ( |c| c. parse ( ) )
@@ -253,10 +253,10 @@ impl Shell {
253
253
254
254
pub fn set_unicode ( & mut self , yes : bool ) -> CargoResult < ( ) > {
255
255
if let ShellOut :: Stream {
256
- ref mut stdout_unicode,
257
- ref mut stderr_unicode,
256
+ stdout_unicode,
257
+ stderr_unicode,
258
258
..
259
- } = self . output
259
+ } = & mut self . output
260
260
{
261
261
* stdout_unicode = yes;
262
262
* stderr_unicode = yes;
@@ -265,10 +265,7 @@ impl Shell {
265
265
}
266
266
267
267
pub fn set_hyperlinks ( & mut self , yes : bool ) -> CargoResult < ( ) > {
268
- if let ShellOut :: Stream {
269
- ref mut hyperlinks, ..
270
- } = self . output
271
- {
268
+ if let ShellOut :: Stream { hyperlinks, .. } = & mut self . output {
272
269
* hyperlinks = yes;
273
270
}
274
271
Ok ( ( ) )
@@ -447,17 +444,17 @@ impl ShellOut {
447
444
448
445
/// Gets stdout as a `io::Write`.
449
446
fn stdout ( & mut self ) -> & mut dyn Write {
450
- match * self {
451
- ShellOut :: Stream { ref mut stdout, .. } => stdout,
452
- ShellOut :: Write ( ref mut w) => w,
447
+ match self {
448
+ ShellOut :: Stream { stdout, .. } => stdout,
449
+ ShellOut :: Write ( w) => w,
453
450
}
454
451
}
455
452
456
453
/// Gets stderr as a `io::Write`.
457
454
fn stderr ( & mut self ) -> & mut dyn Write {
458
- match * self {
459
- ShellOut :: Stream { ref mut stderr, .. } => stderr,
460
- ShellOut :: Write ( ref mut w) => w,
455
+ match self {
456
+ ShellOut :: Stream { stderr, .. } => stderr,
457
+ ShellOut :: Write ( w) => w,
461
458
}
462
459
}
463
460
}
0 commit comments