@@ -29,7 +29,7 @@ use std::{
2929 any:: Any ,
3030 collections:: { HashMap , VecDeque } ,
3131 panic:: AssertUnwindSafe ,
32- path:: PathBuf ,
32+ path:: { Path , PathBuf } ,
3333 str:: FromStr ,
3434 sync:: Arc ,
3535 time:: Duration ,
@@ -647,13 +647,15 @@ pub async fn start_recording(
647647 Ok ( Ok ( rx) ) => rx,
648648 Ok ( Err ( err) ) => {
649649 let message = format ! ( "{err:#}" ) ;
650- handle_spawn_failure ( & app, & state_mtx, & recording_dir, message. clone ( ) ) . await ?;
650+ handle_spawn_failure ( & app, & state_mtx, recording_dir. as_path ( ) , message. clone ( ) )
651+ . await ?;
651652 return Err ( message) ;
652653 }
653654 Err ( panic) => {
654655 let panic_msg = panic_message ( panic) ;
655656 let message = format ! ( "Failed to spawn recording actor: {panic_msg}" ) ;
656- handle_spawn_failure ( & app, & state_mtx, & recording_dir, message. clone ( ) ) . await ?;
657+ handle_spawn_failure ( & app, & state_mtx, recording_dir. as_path ( ) , message. clone ( ) )
658+ . await ?;
657659 return Err ( message) ;
658660 }
659661 } ;
@@ -736,7 +738,7 @@ pub async fn resume_recording(state: MutableState<'_, App>) -> Result<(), String
736738async fn handle_spawn_failure (
737739 app : & AppHandle ,
738740 state_mtx : & MutableState < ' _ , App > ,
739- recording_dir : & PathBuf ,
741+ recording_dir : & Path ,
740742 message : String ,
741743) -> Result < ( ) , String > {
742744 let _ = RecordingEvent :: Failed {
@@ -758,8 +760,13 @@ async fn handle_spawn_failure(
758760 dialog. blocking_show ( ) ;
759761
760762 let mut state = state_mtx. write ( ) . await ;
761- let _ =
762- handle_recording_end ( app. clone ( ) , Err ( message) , & mut state, recording_dir. clone ( ) ) . await ;
763+ let _ = handle_recording_end (
764+ app. clone ( ) ,
765+ Err ( message) ,
766+ & mut state,
767+ recording_dir. to_path_buf ( ) ,
768+ )
769+ . await ;
763770
764771 Ok ( ( ) )
765772}
0 commit comments