1
+ use std:: path:: { Path , PathBuf } ;
2
+
1
3
use regex:: Regex ;
2
4
use similar:: TextDiff ;
3
- use std:: path:: { Path , PathBuf } ;
4
5
5
- use crate :: fs as rfs;
6
6
use build_helper:: drop_bomb:: DropBomb ;
7
7
8
+ use crate :: fs;
9
+
8
10
#[ cfg( test) ]
9
11
mod tests;
10
12
@@ -43,7 +45,7 @@ impl Diff {
43
45
/// Specify the expected output for the diff from a file.
44
46
pub fn expected_file < P : AsRef < Path > > ( & mut self , path : P ) -> & mut Self {
45
47
let path = path. as_ref ( ) ;
46
- let content = rfs :: read_to_string ( path) ;
48
+ let content = fs :: read_to_string ( path) ;
47
49
let name = path. to_string_lossy ( ) . to_string ( ) ;
48
50
49
51
self . expected_file = Some ( path. into ( ) ) ;
@@ -62,7 +64,7 @@ impl Diff {
62
64
/// Specify the actual output for the diff from a file.
63
65
pub fn actual_file < P : AsRef < Path > > ( & mut self , path : P ) -> & mut Self {
64
66
let path = path. as_ref ( ) ;
65
- let content = rfs :: read_to_string ( path) ;
67
+ let content = fs :: read_to_string ( path) ;
66
68
let name = path. to_string_lossy ( ) . to_string ( ) ;
67
69
68
70
self . actual = Some ( content) ;
@@ -116,7 +118,7 @@ impl Diff {
116
118
if let Some ( ref expected_file) = self . expected_file {
117
119
if std:: env:: var ( "RUSTC_BLESS_TEST" ) . is_ok ( ) {
118
120
println ! ( "Blessing `{}`" , expected_file. display( ) ) ;
119
- rfs :: write ( expected_file, actual) ;
121
+ fs :: write ( expected_file, actual) ;
120
122
return ;
121
123
}
122
124
}
@@ -138,7 +140,7 @@ impl Diff {
138
140
if let Some ( ref expected_file) = self . expected_file {
139
141
if std:: env:: var ( "RUSTC_BLESS_TEST" ) . is_ok ( ) {
140
142
println ! ( "Blessing `{}`" , expected_file. display( ) ) ;
141
- rfs :: write ( expected_file, actual) ;
143
+ fs :: write ( expected_file, actual) ;
142
144
return ;
143
145
}
144
146
}
0 commit comments