@@ -5,7 +5,7 @@ use yazi_fs::{File, FilesOp};
55use yazi_macro:: { act, err, ok_or_not_found, succ} ;
66use yazi_parser:: mgr:: RenameOpt ;
77use yazi_proxy:: { ConfirmProxy , InputProxy , MgrProxy } ;
8- use yazi_shared:: { Id , data:: Data , url:: { UrlBuf , UrlLike } } ;
8+ use yazi_shared:: { Id , data:: Data , path :: PathLike , url:: { UrlBuf , UrlLike } } ;
99use yazi_vfs:: { VfsFile , maybe_exists, provider} ;
1010use yazi_watcher:: WATCHER ;
1111
@@ -73,18 +73,18 @@ impl Rename {
7373 && let Some ( ( parent, urn) ) = u. pair ( )
7474 {
7575 ok_or_not_found ! ( provider:: rename( & u, & new) . await ) ;
76- FilesOp :: Deleting ( parent. to_owned ( ) , [ urn. to_owned ( ) ] . into ( ) ) . emit ( ) ;
76+ FilesOp :: Deleting ( parent. to_owned ( ) , [ urn. owned ( ) ] . into ( ) ) . emit ( ) ;
7777 }
7878
7979 let new = provider:: casefold ( & new) . await ?;
8080 let Some ( ( new_p, new_n) ) = new. pair ( ) else { return Ok ( ( ) ) } ;
8181
8282 let file = File :: new ( & new) . await ?;
8383 if new_p == old_p {
84- FilesOp :: Upserting ( old_p. into ( ) , [ ( old_n. to_owned ( ) , file) ] . into ( ) ) . emit ( ) ;
84+ FilesOp :: Upserting ( old_p. into ( ) , [ ( old_n. owned ( ) , file) ] . into ( ) ) . emit ( ) ;
8585 } else {
86- FilesOp :: Deleting ( old_p. into ( ) , [ old_n. to_owned ( ) ] . into ( ) ) . emit ( ) ;
87- FilesOp :: Upserting ( new_p. into ( ) , [ ( new_n. to_owned ( ) , file) ] . into ( ) ) . emit ( ) ;
86+ FilesOp :: Deleting ( old_p. into ( ) , [ old_n. owned ( ) ] . into ( ) ) . emit ( ) ;
87+ FilesOp :: Upserting ( new_p. into ( ) , [ ( new_n. owned ( ) , file) ] . into ( ) ) . emit ( ) ;
8888 }
8989
9090 MgrProxy :: reveal ( & new) ;
0 commit comments