File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -279,7 +279,7 @@ fn get_paths(env_variable_name: &str) -> Vec<String> {
279
279
280
280
#[ cfg( feature = "flame-it" ) ]
281
281
fn write_profile ( matches : & ArgMatches ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
282
- use std:: fs :: File ;
282
+ use std:: { fs , io } ;
283
283
284
284
enum ProfileFormat {
285
285
Html ,
@@ -306,12 +306,14 @@ fn write_profile(matches: &ArgMatches) -> Result<(), Box<dyn std::error::Error>>
306
306
ProfileFormat :: Speedscope => "flamescope.json" . as_ref ( ) ,
307
307
} ) ;
308
308
309
- let profile_output: Box < dyn std :: io:: Write > = if profile_output == "-" {
310
- Box :: new ( std :: io:: stdout ( ) )
309
+ let profile_output: Box < dyn io:: Write > = if profile_output == "-" {
310
+ Box :: new ( io:: stdout ( ) )
311
311
} else {
312
- Box :: new ( File :: create ( profile_output) ?)
312
+ Box :: new ( fs :: File :: create ( profile_output) ?)
313
313
} ;
314
314
315
+ let profile_output = io:: BufWriter :: new ( profile_output) ;
316
+
315
317
match profile_format {
316
318
ProfileFormat :: Html => flame:: dump_html ( profile_output) ?,
317
319
ProfileFormat :: Text => flame:: dump_text_to_writer ( profile_output) ?,
You can’t perform that action at this time.
0 commit comments