11use std:: fs;
22use std:: path:: Path ;
33
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.
55#[ track_caller]
66pub fn remove_file < P : AsRef < Path > > ( path : P ) {
77 fs:: remove_file ( path. as_ref ( ) )
@@ -18,21 +18,21 @@ pub fn copy<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) {
1818 ) ) ;
1919}
2020
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.
2222#[ track_caller]
2323pub fn create_file < P : AsRef < Path > > ( path : P ) {
2424 fs:: File :: create ( path. as_ref ( ) )
2525 . expect ( & format ! ( "the file in path \" {}\" could not be created" , path. as_ref( ) . display( ) ) ) ;
2626}
2727
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.
2929#[ track_caller]
3030pub fn read < P : AsRef < Path > > ( path : P ) -> Vec < u8 > {
3131 fs:: read ( path. as_ref ( ) )
3232 . expect ( & format ! ( "the file in path \" {}\" could not be read" , path. as_ref( ) . display( ) ) )
3333}
3434
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.
3636#[ track_caller]
3737pub fn read_to_string < P : AsRef < Path > > ( path : P ) -> String {
3838 fs:: read_to_string ( path. as_ref ( ) ) . expect ( & format ! (
@@ -41,14 +41,14 @@ pub fn read_to_string<P: AsRef<Path>>(path: P) -> String {
4141 ) )
4242}
4343
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.
4545#[ track_caller]
4646pub fn read_dir < P : AsRef < Path > > ( path : P ) -> fs:: ReadDir {
4747 fs:: read_dir ( path. as_ref ( ) )
4848 . expect ( & format ! ( "the directory in path \" {}\" could not be read" , path. as_ref( ) . display( ) ) )
4949}
5050
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.
5252#[ track_caller]
5353pub fn write < P : AsRef < Path > , C : AsRef < [ u8 ] > > ( path : P , contents : C ) {
5454 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) {
5757 ) ) ;
5858}
5959
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.
6161#[ track_caller]
6262pub fn remove_dir_all < P : AsRef < Path > > ( path : P ) {
6363 fs:: remove_dir_all ( path. as_ref ( ) ) . expect ( & format ! (
@@ -66,7 +66,7 @@ pub fn remove_dir_all<P: AsRef<Path>>(path: P) {
6666 ) ) ;
6767}
6868
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.
7070#[ track_caller]
7171pub fn create_dir < P : AsRef < Path > > ( path : P ) {
7272 fs:: create_dir ( path. as_ref ( ) ) . expect ( & format ! (
@@ -75,7 +75,7 @@ pub fn create_dir<P: AsRef<Path>>(path: P) {
7575 ) ) ;
7676}
7777
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.
7979#[ track_caller]
8080pub fn create_dir_all < P : AsRef < Path > > ( path : P ) {
8181 fs:: create_dir_all ( path. as_ref ( ) ) . expect ( & format ! (
@@ -84,7 +84,7 @@ pub fn create_dir_all<P: AsRef<Path>>(path: P) {
8484 ) ) ;
8585}
8686
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.
8888#[ track_caller]
8989pub fn metadata < P : AsRef < Path > > ( path : P ) -> fs:: Metadata {
9090 fs:: metadata ( path. as_ref ( ) ) . expect ( & format ! (
0 commit comments