File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed
Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -318,26 +318,22 @@ fn parse_options(args: &ArgMatches) -> Result<NumfmtOptions> {
318318}
319319
320320fn print_debug_warnings ( options : & NumfmtOptions , matches : & ArgMatches ) {
321+ fn print_warning ( msg_key : & str ) {
322+ let _ = writeln ! ( stderr( ) , "numfmt: {}" , translate!( msg_key) ) ;
323+ }
324+
321325 // Warn if no conversion option is specified
322326 // 2>/dev/full does not abort
323327 if options. transform . from == Unit :: None
324328 && options. transform . to == Unit :: None
325329 && options. padding == 0
326330 {
327- let _ = writeln ! (
328- stderr( ) ,
329- "numfmt: {}" ,
330- translate!( "numfmt-debug-no-conversion" )
331- ) ;
331+ print_warning ( "numfmt-debug-no-conversion" ) ;
332332 }
333333
334334 // Warn if --header is used with command-line input
335335 if options. header > 0 && matches. get_many :: < OsString > ( NUMBER ) . is_some ( ) {
336- let _ = writeln ! (
337- stderr( ) ,
338- "numfmt: {}" ,
339- translate!( "numfmt-debug-header-ignored" )
340- ) ;
336+ print_warning ( "numfmt-debug-header-ignored" ) ;
341337 }
342338}
343339
You can’t perform that action at this time.
0 commit comments