Skip to content

Commit bde6b1a

Browse files
committed
Also run cargo fmt
1 parent 96c4b85 commit bde6b1a

4 files changed

Lines changed: 42 additions & 14 deletions

File tree

examples/async_std_fs_misc.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ async fn main() {
4545
println!("`mkdir a`");
4646

4747
// Create a directory, returns `io::Result<()>`
48-
if let Err(why) = cwd.create_dir("a") { println!("! {:?}", why.kind()) }
48+
if let Err(why) = cwd.create_dir("a") {
49+
println!("! {:?}", why.kind())
50+
}
4951

5052
println!("`echo hello > a/b.txt`");
5153
// The previous match can be simplified using the `unwrap_or_else` method

examples/std_fs_misc.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ fn main() {
3939
println!("`mkdir a`");
4040

4141
// Create a directory, returns `io::Result<()>`
42-
if let Err(why) = cwd.create_dir("a") { println!("! {:?}", why.kind()) }
42+
if let Err(why) = cwd.create_dir("a") {
43+
println!("! {:?}", why.kind())
44+
}
4345

4446
println!("`echo hello > a/b.txt`");
4547
// The previous match can be simplified using the `unwrap_or_else` method

tests/fs.rs

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,9 @@ fn copy_file_dst_dir() {
815815
let out = "out";
816816

817817
check!(tmpdir.create(out));
818-
if let Ok(..) = tmpdir.copy(out, &tmpdir, ".") { panic!() }
818+
if let Ok(..) = tmpdir.copy(out, &tmpdir, ".") {
819+
panic!()
820+
}
819821
}
820822

821823
#[test]
@@ -838,7 +840,9 @@ fn copy_file_src_dir() {
838840
let tmpdir = tmpdir();
839841
let out = "out";
840842

841-
if let Ok(..) = tmpdir.copy(".", &tmpdir, out) { panic!() }
843+
if let Ok(..) = tmpdir.copy(".", &tmpdir, out) {
844+
panic!()
845+
}
842846
assert!(!tmpdir.exists(out));
843847
}
844848

@@ -976,7 +980,9 @@ fn read_link() {
976980
#[test]
977981
fn readlink_not_symlink() {
978982
let tmpdir = tmpdir();
979-
if tmpdir.read_link(".").is_ok() { panic!("wanted a failure") }
983+
if tmpdir.read_link(".").is_ok() {
984+
panic!("wanted a failure")
985+
}
980986
}
981987

982988
#[cfg(not(windows))]
@@ -1030,9 +1036,13 @@ fn links_work() {
10301036
assert_eq!(v, b"foobar".to_vec());
10311037

10321038
// can't link to yourself
1033-
if let Ok(..) = tmpdir.hard_link(input, &tmpdir, input) { panic!("wanted a failure") }
1039+
if let Ok(..) = tmpdir.hard_link(input, &tmpdir, input) {
1040+
panic!("wanted a failure")
1041+
}
10341042
// can't link to something that doesn't exist
1035-
if tmpdir.hard_link("foo", &tmpdir, "bar").is_ok() { panic!("wanted a failure") }
1043+
if tmpdir.hard_link("foo", &tmpdir, "bar").is_ok() {
1044+
panic!("wanted a failure")
1045+
}
10361046
}
10371047

10381048
#[test]
@@ -1049,7 +1059,9 @@ fn chmod_works() {
10491059
let attr = check!(tmpdir.metadata(file));
10501060
assert!(attr.permissions().readonly());
10511061

1052-
if tmpdir.set_permissions("foo", p.clone()).is_ok() { panic!("wanted an error") }
1062+
if tmpdir.set_permissions("foo", p.clone()).is_ok() {
1063+
panic!("wanted an error")
1064+
}
10531065

10541066
p.set_readonly(false);
10551067
check!(tmpdir.set_permissions(file, p));

tests/fs_utf8.rs

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,9 @@ fn copy_file_dst_dir() {
818818
let out = "out";
819819

820820
check!(tmpdir.create(out));
821-
if let Ok(..) = tmpdir.copy(out, &tmpdir, ".") { panic!() }
821+
if let Ok(..) = tmpdir.copy(out, &tmpdir, ".") {
822+
panic!()
823+
}
822824
}
823825

824826
#[test]
@@ -841,7 +843,9 @@ fn copy_file_src_dir() {
841843
let tmpdir = tmpdir();
842844
let out = "out";
843845

844-
if let Ok(..) = tmpdir.copy(".", &tmpdir, out) { panic!() }
846+
if let Ok(..) = tmpdir.copy(".", &tmpdir, out) {
847+
panic!()
848+
}
845849
assert!(!tmpdir.exists(out));
846850
}
847851

@@ -979,7 +983,9 @@ fn read_link() {
979983
#[test]
980984
fn readlink_not_symlink() {
981985
let tmpdir = tmpdir();
982-
if tmpdir.read_link(".").is_ok() { panic!("wanted a failure") }
986+
if tmpdir.read_link(".").is_ok() {
987+
panic!("wanted a failure")
988+
}
983989
}
984990

985991
#[cfg(not(windows))]
@@ -1027,9 +1033,13 @@ fn links_work() {
10271033
assert_eq!(v, b"foobar".to_vec());
10281034

10291035
// can't link to yourself
1030-
if let Ok(..) = tmpdir.hard_link(input, &tmpdir, input) { panic!("wanted a failure") }
1036+
if let Ok(..) = tmpdir.hard_link(input, &tmpdir, input) {
1037+
panic!("wanted a failure")
1038+
}
10311039
// can't link to something that doesn't exist
1032-
if tmpdir.hard_link("foo", &tmpdir, "bar").is_ok() { panic!("wanted a failure") }
1040+
if tmpdir.hard_link("foo", &tmpdir, "bar").is_ok() {
1041+
panic!("wanted a failure")
1042+
}
10331043
}
10341044

10351045
#[test]
@@ -1046,7 +1056,9 @@ fn chmod_works() {
10461056
let attr = check!(tmpdir.metadata(file));
10471057
assert!(attr.permissions().readonly());
10481058

1049-
if tmpdir.set_permissions("foo", p.clone()).is_ok() { panic!("wanted an error") }
1059+
if tmpdir.set_permissions("foo", p.clone()).is_ok() {
1060+
panic!("wanted an error")
1061+
}
10501062

10511063
p.set_readonly(false);
10521064
check!(tmpdir.set_permissions(file, p));

0 commit comments

Comments
 (0)