@@ -68,10 +68,7 @@ impl Harness<StateArgs> {
6868 }
6969 . write_global ( ) ;
7070
71- let notifier = notifier ( & opts) . unwrap_or_else ( |err| {
72- eprintln ! ( "{err}" ) ;
73- std:: process:: exit ( 1 )
74- } ) ;
71+ let notifier = notifier ( & opts) ;
7572
7673 Ok ( Harness {
7774 state : StateParsed {
@@ -228,26 +225,17 @@ fn parse_argfile(path: &std::path::Path) -> std::io::Result<Vec<std::ffi::OsStri
228225 Ok ( content. lines ( ) . map ( |s| s. into ( ) ) . collect ( ) )
229226}
230227
231- fn notifier ( opts : & libtest_lexarg:: TestOpts ) -> std :: io :: Result < Box < dyn notify:: Notifier > > {
228+ fn notifier ( opts : & libtest_lexarg:: TestOpts ) -> Box < dyn notify:: Notifier > {
232229 #[ cfg( feature = "color" ) ]
233230 let stdout = anstream:: stdout ( ) ;
234231 #[ cfg( not( feature = "color" ) ) ]
235232 let stdout = std:: io:: stdout ( ) ;
236- let notifier: Box < dyn notify:: Notifier > = match opts. format {
237- #[ cfg( feature = "json" ) ]
233+ match opts. format {
238234 OutputFormat :: Json => Box :: new ( notify:: JsonNotifier :: new ( stdout) ) ,
239- #[ cfg( not( feature = "json" ) ) ]
240- OutputFormat :: Json => {
241- return Err ( std:: io:: Error :: new (
242- std:: io:: ErrorKind :: Other ,
243- "`--format=json` is not supported" ,
244- ) ) ;
245- }
246235 _ if opts. list => Box :: new ( notify:: TerseListNotifier :: new ( stdout) ) ,
247236 OutputFormat :: Pretty => Box :: new ( notify:: PrettyRunNotifier :: new ( stdout) ) ,
248237 OutputFormat :: Terse => Box :: new ( notify:: TerseRunNotifier :: new ( stdout) ) ,
249- } ;
250- Ok ( notifier)
238+ }
251239}
252240
253241fn discover (
0 commit comments