@@ -250,7 +250,7 @@ fn remove_default_toolchain_autoinstalls() {
250
250
fn remove_override_toolchain_err_handling ( ) {
251
251
setup ( & |config| {
252
252
let tempdir = tempfile:: Builder :: new ( ) . prefix ( "rustup" ) . tempdir ( ) . unwrap ( ) ;
253
- config. change_dir ( tempdir. path ( ) , & || {
253
+ config. change_dir ( tempdir. path ( ) , & |config | {
254
254
config. expect_ok ( & [ "rustup" , "default" , "nightly" ] ) ;
255
255
config. expect_ok ( & [ "rustup" , "override" , "add" , "beta" ] ) ;
256
256
config. expect_ok ( & [ "rustup" , "toolchain" , "remove" , "beta" ] ) ;
@@ -354,7 +354,7 @@ fn override_overrides_default() {
354
354
setup ( & |config| {
355
355
let tempdir = tempfile:: Builder :: new ( ) . prefix ( "rustup" ) . tempdir ( ) . unwrap ( ) ;
356
356
config. expect_ok ( & [ "rustup" , "default" , "nightly" ] ) ;
357
- config. change_dir ( tempdir. path ( ) , & || {
357
+ config. change_dir ( tempdir. path ( ) , & |config | {
358
358
config. expect_ok ( & [ "rustup" , "override" , "add" , "beta" ] ) ;
359
359
config. expect_stdout_ok ( & [ "rustc" , "--version" ] , "hash-beta-1.2.0" ) ;
360
360
} ) ;
@@ -368,19 +368,19 @@ fn multiple_overrides() {
368
368
let tempdir2 = tempfile:: Builder :: new ( ) . prefix ( "rustup" ) . tempdir ( ) . unwrap ( ) ;
369
369
370
370
config. expect_ok ( & [ "rustup" , "default" , "nightly" ] ) ;
371
- config. change_dir ( tempdir1. path ( ) , & || {
371
+ config. change_dir ( tempdir1. path ( ) , & |config | {
372
372
config. expect_ok ( & [ "rustup" , "override" , "add" , "beta" ] ) ;
373
373
} ) ;
374
- config. change_dir ( tempdir2. path ( ) , & || {
374
+ config. change_dir ( tempdir2. path ( ) , & |config | {
375
375
config. expect_ok ( & [ "rustup" , "override" , "add" , "stable" ] ) ;
376
376
} ) ;
377
377
378
378
config. expect_stdout_ok ( & [ "rustc" , "--version" ] , "hash-nightly-2" ) ;
379
379
380
- config. change_dir ( tempdir1. path ( ) , & || {
380
+ config. change_dir ( tempdir1. path ( ) , & |config | {
381
381
config. expect_stdout_ok ( & [ "rustc" , "--version" ] , "hash-beta-1.2.0" ) ;
382
382
} ) ;
383
- config. change_dir ( tempdir2. path ( ) , & || {
383
+ config. change_dir ( tempdir2. path ( ) , & |config | {
384
384
config. expect_stdout_ok ( & [ "rustc" , "--version" ] , "hash-stable-1.1.0" ) ;
385
385
} ) ;
386
386
} ) ;
@@ -404,7 +404,7 @@ fn override_windows_root() {
404
404
// Really sketchy to be messing with C:\ in a test...
405
405
let prefix = prefix. as_os_str ( ) . to_str ( ) . unwrap ( ) ;
406
406
let prefix = format ! ( "{prefix}\\ " ) ;
407
- config. change_dir ( & PathBuf :: from ( & prefix) , & || {
407
+ config. change_dir ( & PathBuf :: from ( & prefix) , & |config | {
408
408
config. expect_ok ( & [ "rustup" , "default" , "stable" ] ) ;
409
409
config. expect_ok ( & [ "rustup" , "override" , "add" , "nightly" ] ) ;
410
410
config. expect_stdout_ok ( & [ "rustc" , "--version" ] , "hash-nightly-2" ) ;
@@ -418,7 +418,7 @@ fn override_windows_root() {
418
418
fn change_override ( ) {
419
419
setup ( & |config| {
420
420
let tempdir = tempfile:: Builder :: new ( ) . prefix ( "rustup" ) . tempdir ( ) . unwrap ( ) ;
421
- config. change_dir ( tempdir. path ( ) , & || {
421
+ config. change_dir ( tempdir. path ( ) , & |config | {
422
422
config. expect_ok ( & [ "rustup" , "override" , "add" , "nightly" ] ) ;
423
423
config. expect_ok ( & [ "rustup" , "override" , "add" , "beta" ] ) ;
424
424
config. expect_stdout_ok ( & [ "rustc" , "--version" ] , "hash-beta-1.2.0" ) ;
@@ -430,7 +430,7 @@ fn change_override() {
430
430
fn remove_override_no_default ( ) {
431
431
setup ( & |config| {
432
432
let tempdir = tempfile:: Builder :: new ( ) . prefix ( "rustup" ) . tempdir ( ) . unwrap ( ) ;
433
- config. change_dir ( tempdir. path ( ) , & || {
433
+ config. change_dir ( tempdir. path ( ) , & |config | {
434
434
config. expect_ok ( & [ "rustup" , "override" , "add" , "nightly" ] ) ;
435
435
config. expect_ok ( & [ "rustup" , "override" , "remove" ] ) ;
436
436
config. expect_err (
@@ -445,7 +445,7 @@ fn remove_override_no_default() {
445
445
fn remove_override_with_default ( ) {
446
446
setup ( & |config| {
447
447
let tempdir = tempfile:: Builder :: new ( ) . prefix ( "rustup" ) . tempdir ( ) . unwrap ( ) ;
448
- config. change_dir ( tempdir. path ( ) , & || {
448
+ config. change_dir ( tempdir. path ( ) , & |config | {
449
449
config. expect_ok ( & [ "rustup" , "default" , "nightly" ] ) ;
450
450
config. expect_ok ( & [ "rustup" , "override" , "add" , "beta" ] ) ;
451
451
config. expect_ok ( & [ "rustup" , "override" , "remove" ] ) ;
@@ -460,18 +460,18 @@ fn remove_override_with_multiple_overrides() {
460
460
let tempdir1 = tempfile:: Builder :: new ( ) . prefix ( "rustup" ) . tempdir ( ) . unwrap ( ) ;
461
461
let tempdir2 = tempfile:: Builder :: new ( ) . prefix ( "rustup" ) . tempdir ( ) . unwrap ( ) ;
462
462
config. expect_ok ( & [ "rustup" , "default" , "nightly" ] ) ;
463
- config. change_dir ( tempdir1. path ( ) , & || {
463
+ config. change_dir ( tempdir1. path ( ) , & |config | {
464
464
config. expect_ok ( & [ "rustup" , "override" , "add" , "beta" ] ) ;
465
465
} ) ;
466
- config. change_dir ( tempdir2. path ( ) , & || {
466
+ config. change_dir ( tempdir2. path ( ) , & |config | {
467
467
config. expect_ok ( & [ "rustup" , "override" , "add" , "stable" ] ) ;
468
468
} ) ;
469
469
config. expect_stdout_ok ( & [ "rustc" , "--version" ] , "hash-nightly-2" ) ;
470
- config. change_dir ( tempdir1. path ( ) , & || {
470
+ config. change_dir ( tempdir1. path ( ) , & |config | {
471
471
config. expect_ok ( & [ "rustup" , "override" , "remove" ] ) ;
472
472
config. expect_stdout_ok ( & [ "rustc" , "--version" ] , "hash-nightly-2" ) ;
473
473
} ) ;
474
- config. change_dir ( tempdir2. path ( ) , & || {
474
+ config. change_dir ( tempdir2. path ( ) , & |config | {
475
475
config. expect_stdout_ok ( & [ "rustc" , "--version" ] , "hash-stable-1.1.0" ) ;
476
476
} ) ;
477
477
} ) ;
0 commit comments