1
1
use std:: fs;
2
2
use std:: path:: Path ;
3
3
4
- /// A wrapper around [`std::fs::remove_file`] which includes the file path in the panic message..
4
+ /// A wrapper around [`std::fs::remove_file`] which includes the file path in the panic message.
5
5
#[ track_caller]
6
6
pub fn remove_file < P : AsRef < Path > > ( path : P ) {
7
7
fs:: remove_file ( path. as_ref ( ) )
@@ -18,21 +18,21 @@ pub fn copy<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) {
18
18
) ) ;
19
19
}
20
20
21
- /// A wrapper around [`std::fs::File::create`] which includes the file path in the panic message..
21
+ /// A wrapper around [`std::fs::File::create`] which includes the file path in the panic message.
22
22
#[ track_caller]
23
23
pub fn create_file < P : AsRef < Path > > ( path : P ) {
24
24
fs:: File :: create ( path. as_ref ( ) )
25
25
. expect ( & format ! ( "the file in path \" {}\" could not be created" , path. as_ref( ) . display( ) ) ) ;
26
26
}
27
27
28
- /// A wrapper around [`std::fs::read`] which includes the file path in the panic message..
28
+ /// A wrapper around [`std::fs::read`] which includes the file path in the panic message.
29
29
#[ track_caller]
30
30
pub fn read < P : AsRef < Path > > ( path : P ) -> Vec < u8 > {
31
31
fs:: read ( path. as_ref ( ) )
32
32
. expect ( & format ! ( "the file in path \" {}\" could not be read" , path. as_ref( ) . display( ) ) )
33
33
}
34
34
35
- /// A wrapper around [`std::fs::read_to_string`] which includes the file path in the panic message..
35
+ /// A wrapper around [`std::fs::read_to_string`] which includes the file path in the panic message.
36
36
#[ track_caller]
37
37
pub fn read_to_string < P : AsRef < Path > > ( path : P ) -> String {
38
38
fs:: read_to_string ( path. as_ref ( ) ) . expect ( & format ! (
@@ -41,14 +41,14 @@ pub fn read_to_string<P: AsRef<Path>>(path: P) -> String {
41
41
) )
42
42
}
43
43
44
- /// A wrapper around [`std::fs::read_dir`] which includes the file path in the panic message..
44
+ /// A wrapper around [`std::fs::read_dir`] which includes the file path in the panic message.
45
45
#[ track_caller]
46
46
pub fn read_dir < P : AsRef < Path > > ( path : P ) -> fs:: ReadDir {
47
47
fs:: read_dir ( path. as_ref ( ) )
48
48
. expect ( & format ! ( "the directory in path \" {}\" could not be read" , path. as_ref( ) . display( ) ) )
49
49
}
50
50
51
- /// A wrapper around [`std::fs::write`] which includes the file path in the panic message..
51
+ /// A wrapper around [`std::fs::write`] which includes the file path in the panic message.
52
52
#[ track_caller]
53
53
pub fn write < P : AsRef < Path > , C : AsRef < [ u8 ] > > ( path : P , contents : C ) {
54
54
fs:: write ( path. as_ref ( ) , contents. as_ref ( ) ) . expect ( & format ! (
@@ -57,7 +57,7 @@ pub fn write<P: AsRef<Path>, C: AsRef<[u8]>>(path: P, contents: C) {
57
57
) ) ;
58
58
}
59
59
60
- /// A wrapper around [`std::fs::remove_dir_all`] which includes the file path in the panic message..
60
+ /// A wrapper around [`std::fs::remove_dir_all`] which includes the file path in the panic message.
61
61
#[ track_caller]
62
62
pub fn remove_dir_all < P : AsRef < Path > > ( path : P ) {
63
63
fs:: remove_dir_all ( path. as_ref ( ) ) . expect ( & format ! (
@@ -66,7 +66,7 @@ pub fn remove_dir_all<P: AsRef<Path>>(path: P) {
66
66
) ) ;
67
67
}
68
68
69
- /// A wrapper around [`std::fs::create_dir`] which includes the file path in the panic message..
69
+ /// A wrapper around [`std::fs::create_dir`] which includes the file path in the panic message.
70
70
#[ track_caller]
71
71
pub fn create_dir < P : AsRef < Path > > ( path : P ) {
72
72
fs:: create_dir ( path. as_ref ( ) ) . expect ( & format ! (
@@ -75,7 +75,7 @@ pub fn create_dir<P: AsRef<Path>>(path: P) {
75
75
) ) ;
76
76
}
77
77
78
- /// A wrapper around [`std::fs::create_dir_all`] which includes the file path in the panic message..
78
+ /// A wrapper around [`std::fs::create_dir_all`] which includes the file path in the panic message.
79
79
#[ track_caller]
80
80
pub fn create_dir_all < P : AsRef < Path > > ( path : P ) {
81
81
fs:: create_dir_all ( path. as_ref ( ) ) . expect ( & format ! (
@@ -84,7 +84,7 @@ pub fn create_dir_all<P: AsRef<Path>>(path: P) {
84
84
) ) ;
85
85
}
86
86
87
- /// A wrapper around [`std::fs::metadata`] which includes the file path in the panic message..
87
+ /// A wrapper around [`std::fs::metadata`] which includes the file path in the panic message.
88
88
#[ track_caller]
89
89
pub fn metadata < P : AsRef < Path > > ( path : P ) -> fs:: Metadata {
90
90
fs:: metadata ( path. as_ref ( ) ) . expect ( & format ! (
0 commit comments