File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- use std:: { cell:: RefCell , path:: PathBuf , rc:: Rc } ;
1+ use std:: { cell:: Cell , path:: PathBuf , rc:: Rc } ;
22
33use block2:: StackBlock ;
44use objc2:: rc:: Retained ;
@@ -184,10 +184,9 @@ async unsafe fn filebox(
184184
185185 let res = if let Some ( parent) = & parent {
186186 let ( tx, rx) = local_sync:: oneshot:: channel ( ) ;
187- let tx = Rc :: new ( RefCell :: new ( Some ( tx) ) ) ;
187+ let tx = Rc :: new ( Cell :: new ( Some ( tx) ) ) ;
188188 let block = StackBlock :: new ( move |res| {
189- tx. borrow_mut ( )
190- . take ( )
189+ tx. take ( )
191190 . expect ( "the handler should only be called once" )
192191 . send ( res)
193192 . ok ( ) ;
Original file line number Diff line number Diff line change 1- use std:: { cell:: RefCell , rc:: Rc } ;
1+ use std:: { cell:: Cell , rc:: Rc } ;
22
33use block2:: StackBlock ;
44use compio:: buf:: arrayvec:: ArrayVec ;
@@ -82,10 +82,9 @@ async fn msgbox_custom(
8282
8383 if let Some ( parent) = & parent {
8484 let ( tx, rx) = local_sync:: oneshot:: channel ( ) ;
85- let tx = Rc :: new ( RefCell :: new ( Some ( tx) ) ) ;
85+ let tx = Rc :: new ( Cell :: new ( Some ( tx) ) ) ;
8686 let block = StackBlock :: new ( move |res| {
87- tx. borrow_mut ( )
88- . take ( )
87+ tx. take ( )
8988 . expect ( "the handler should only be called once" )
9089 . send ( responses[ ( res - NSAlertFirstButtonReturn ) as usize ] )
9190 . ok ( ) ;
You can’t perform that action at this time.
0 commit comments