File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -306,15 +306,14 @@ impl LogViewerApp {
306
306
}
307
307
LoadingStatus :: Failed ( err_msg) => {
308
308
let msg = format ! ( "Loading failed: {err_msg}" ) ;
309
- let msg = msg. replace ( r"\n" , "\n " ) ;
310
- let msg = msg. replace ( r#"\""# , "\" " ) ;
311
309
if ui. button ( "Clear Error Status" ) . clicked ( ) {
312
310
self . loading_status = LoadingStatus :: NotInProgress ;
313
311
}
314
312
ui. colored_label ( ui. visuals ( ) . error_fg_color , msg) ;
315
313
}
316
314
LoadingStatus :: Success ( data) => {
317
315
self . loading_status =
316
+ // TODO 1: Make a copy of the loading type desired and match on it to get the data to load
318
317
match Data :: try_from ( ( self . row_idx_field_name . as_ref ( ) , & data[ ..] ) ) {
319
318
Ok ( mut data) => {
320
319
if let Some ( old_data) = self . data . as_mut ( ) {
@@ -332,7 +331,7 @@ impl LogViewerApp {
332
331
}
333
332
LoadingStatus :: NotInProgress
334
333
}
335
- Err ( e) => LoadingStatus :: Failed ( format ! ( "{e:?}" ) ) ,
334
+ Err ( e) => LoadingStatus :: Failed ( clean_msg ( format ! ( "{e:?}" ) ) ) ,
336
335
}
337
336
}
338
337
}
@@ -856,3 +855,7 @@ fn with_separators(value: usize) -> String {
856
855
. unwrap ( )
857
856
. join ( "," )
858
857
}
858
+
859
+ fn clean_msg < S : AsRef < str > > ( msg : S ) -> String {
860
+ msg. as_ref ( ) . replace ( r"\n" , "\n " ) . replace ( r#"\""# , "\" " )
861
+ }
You can’t perform that action at this time.
0 commit comments