1
1
//@ ignore-windows
2
2
3
3
// This test attempts to make sure that running `remove_dir_all`
4
- // doesn't result in a NotFound error one of the files it
4
+ // doesn't result in a NotFound error if one of the files it
5
5
// is deleting is deleted concurrently.
6
6
//
7
7
// The windows implementation for `remove_dir_all` is significantly
8
8
// more complicated, and has not yet been brought up to par with
9
9
// the implementation on other platforms, so this test is marked as
10
- // `ignore-windows` until someone more expirenced with windows can
10
+ // `ignore-windows` until someone more experienced with windows can
11
11
// sort that out.
12
12
13
13
use std:: fs:: remove_dir_all;
@@ -27,13 +27,12 @@ fn main() {
27
27
write ( "outer/inner.txt" , b"sometext" ) ;
28
28
29
29
thread:: scope ( |scope| {
30
- let t1 = scope. spawn ( || {
30
+ scope. spawn ( || {
31
31
thread:: sleep ( Duration :: from_nanos ( i) ) ;
32
32
remove_dir_all ( "outer" ) . unwrap ( ) ;
33
33
} ) ;
34
34
35
- let race_happened_ref = & race_happened;
36
- let t2 = scope. spawn ( || {
35
+ scope. spawn ( || {
37
36
let r1 = remove_dir_all ( "outer/inner" ) ;
38
37
let r2 = remove_dir_all ( "outer/inner.txt" ) ;
39
38
if r1. is_ok ( ) && r2. is_err ( ) {
@@ -44,10 +43,10 @@ fn main() {
44
43
45
44
assert ! ( !Path :: new( "outer" ) . exists( ) ) ;
46
45
47
- // trying to remove a nonexistant top-level directory should
46
+ // trying to remove a nonexistent top-level directory should
48
47
// still result in an error.
49
48
let Err ( err) = remove_dir_all ( "outer" ) else {
50
- panic ! ( "removing nonexistant dir did not result in an error" ) ;
49
+ panic ! ( "removing nonexistent dir did not result in an error" ) ;
51
50
} ;
52
51
assert_eq ! ( err. kind( ) , std:: io:: ErrorKind :: NotFound ) ;
53
52
}
0 commit comments