File tree 1 file changed +8
-5
lines changed
1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -288,10 +288,13 @@ impl Plot {
288
288
289
289
// Save the rendered plot to the temp file.
290
290
let temp_path = temp. to_str ( ) . unwrap ( ) ;
291
- let mut file = File :: create ( temp_path) . unwrap ( ) ;
292
- file. write_all ( rendered. as_bytes ( ) )
293
- . expect ( "failed to write html output" ) ;
294
- file. flush ( ) . unwrap ( ) ;
291
+
292
+ {
293
+ let mut file = File :: create ( temp_path) . unwrap ( ) ;
294
+ file. write_all ( rendered. as_bytes ( ) )
295
+ . expect ( "failed to write html output" ) ;
296
+ file. flush ( ) . unwrap ( ) ;
297
+ }
295
298
296
299
// Hand off the job of opening the browser to an OS-specific implementation.
297
300
Plot :: show_with_default_app ( temp_path) ;
@@ -467,7 +470,7 @@ impl Plot {
467
470
Command :: new ( "cmd" )
468
471
. arg ( "/C" )
469
472
. arg ( format ! ( "start {}" , temp_path) )
470
- . spawn ( )
473
+ . output ( )
471
474
. expect ( DEFAULT_HTML_APP_NOT_FOUND ) ;
472
475
}
473
476
}
You can’t perform that action at this time.
0 commit comments