@@ -3,6 +3,8 @@ use crate::cli::{lint_command, LintRunner};
3
3
#[ cfg( test) ]
4
4
use crate :: runner:: Runner ;
5
5
#[ cfg( test) ]
6
+ use cow_utils:: CowUtils ;
7
+ #[ cfg( test) ]
6
8
use regex:: Regex ;
7
9
#[ cfg( test) ]
8
10
use std:: { env, path:: PathBuf } ;
@@ -78,10 +80,8 @@ impl Tester {
78
80
79
81
// do not output the current working directory, each machine has a different one
80
82
let cwd_string = current_cwd. to_str ( ) . unwrap ( ) ;
81
- #[ allow( clippy:: disallowed_methods) ]
82
- let cwd_string = cwd_string. replace ( '\\' , "/" ) ;
83
- #[ allow( clippy:: disallowed_methods) ]
84
- let output_string = output_string. replace ( & cwd_string, "<cwd>" ) ;
83
+ let cwd_string = cwd_string. cow_replace ( '\\' , "/" ) . to_string ( ) ; // for windows
84
+ let output_string = output_string. cow_replace ( & cwd_string, "<cwd>" ) ;
85
85
86
86
let full_args_list =
87
87
multiple_args. iter ( ) . map ( |args| args. join ( " " ) ) . collect :: < Vec < String > > ( ) . join ( " " ) ;
@@ -90,8 +90,7 @@ impl Tester {
90
90
91
91
// windows can not handle filenames with *
92
92
// allow replace instead of cow_replace. It only test
93
- #[ allow( clippy:: disallowed_methods) ]
94
- let snapshot_file_name = snapshot_file_name. replace ( '*' , "_" ) ;
93
+ let snapshot_file_name = snapshot_file_name. cow_replace ( '*' , "_" ) . to_string ( ) ;
95
94
settings. bind ( || {
96
95
insta:: assert_snapshot!( snapshot_file_name, output_string) ;
97
96
} ) ;
0 commit comments