File tree 1 file changed +13
-4
lines changed 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,15 @@ use std::str::FromStr;
28
28
29
29
use getopts:: { Matches , Options } ;
30
30
31
+ macro_rules! msg {
32
+ ( $( $arg: tt) * ) => (
33
+ match writeln!( & mut :: std:: io:: stderr( ) , $( $arg) * ) {
34
+ Ok ( _) => { } ,
35
+ Err ( x) => panic!( "Unable to write to stderr: {}" , x) ,
36
+ }
37
+ )
38
+ }
39
+
31
40
/// Rustfmt operations.
32
41
enum Operation {
33
42
/// Format files and their child modules.
@@ -203,7 +212,7 @@ fn execute() -> i32 {
203
212
path = path_tmp;
204
213
} ;
205
214
if let Some ( path) = path. as_ref ( ) {
206
- println ! ( "Using rustfmt config file {}" , path. display( ) ) ;
215
+ msg ! ( "Using rustfmt config file {}" , path. display( ) ) ;
207
216
}
208
217
for file in files {
209
218
// Check the file directory if the config-path could not be read or not provided
@@ -213,9 +222,9 @@ fn execute() -> i32 {
213
222
for {}",
214
223
file. display( ) ) ) ;
215
224
if let Some ( path) = path_tmp. as_ref ( ) {
216
- println ! ( "Using rustfmt config file {} for {}" ,
217
- path. display( ) ,
218
- file. display( ) ) ;
225
+ msg ! ( "Using rustfmt config file {} for {}" ,
226
+ path. display( ) ,
227
+ file. display( ) ) ;
219
228
}
220
229
config = config_tmp;
221
230
}
You can’t perform that action at this time.
0 commit comments