@@ -65,19 +65,19 @@ impl NumericEntry for Spinbox {
6565
6666 fn on_changed < ' ctx , F : FnMut ( i32 ) + ' ctx > ( & mut self , _ctx : & ' ctx UI , callback : F ) {
6767 unsafe {
68- let mut data: Box < Box < FnMut ( i32 ) > > = Box :: new ( Box :: new ( callback) ) ;
68+ let mut data: Box < Box < dyn FnMut ( i32 ) > > = Box :: new ( Box :: new ( callback) ) ;
6969 ui_sys:: uiSpinboxOnChanged (
7070 self . uiSpinbox ,
7171 Some ( c_callback) ,
72- & mut * data as * mut Box < FnMut ( i32 ) > as * mut c_void ,
72+ & mut * data as * mut Box < dyn FnMut ( i32 ) > as * mut c_void ,
7373 ) ;
7474 mem:: forget ( data) ;
7575 }
7676
7777 extern "C" fn c_callback ( spinbox : * mut uiSpinbox , data : * mut c_void ) {
7878 unsafe {
7979 let val = ui_sys:: uiSpinboxValue ( spinbox) ;
80- mem:: transmute :: < * mut c_void , & mut Box < FnMut ( i32 ) > > ( data) ( val) ;
80+ mem:: transmute :: < * mut c_void , & mut Box < dyn FnMut ( i32 ) > > ( data) ( val) ;
8181 }
8282 }
8383 }
@@ -94,19 +94,19 @@ impl NumericEntry for Slider {
9494
9595 fn on_changed < ' ctx , F : FnMut ( i32 ) + ' ctx > ( & mut self , _ctx : & ' ctx UI , callback : F ) {
9696 unsafe {
97- let mut data: Box < Box < FnMut ( i32 ) > > = Box :: new ( Box :: new ( callback) ) ;
97+ let mut data: Box < Box < dyn FnMut ( i32 ) > > = Box :: new ( Box :: new ( callback) ) ;
9898 ui_sys:: uiSliderOnChanged (
9999 self . uiSlider ,
100100 Some ( c_callback) ,
101- & mut * data as * mut Box < FnMut ( i32 ) > as * mut c_void ,
101+ & mut * data as * mut Box < dyn FnMut ( i32 ) > as * mut c_void ,
102102 ) ;
103103 mem:: forget ( data) ;
104104 }
105105
106106 extern "C" fn c_callback ( slider : * mut uiSlider , data : * mut c_void ) {
107107 unsafe {
108108 let val = ui_sys:: uiSliderValue ( slider) ;
109- mem:: transmute :: < * mut c_void , & mut Box < FnMut ( i32 ) > > ( data) ( val) ;
109+ mem:: transmute :: < * mut c_void , & mut Box < dyn FnMut ( i32 ) > > ( data) ( val) ;
110110 }
111111 }
112112 }
@@ -163,11 +163,11 @@ impl TextEntry for Entry {
163163
164164 fn on_changed < ' ctx , F : FnMut ( String ) + ' ctx > ( & mut self , _ctx : & ' ctx UI , callback : F ) {
165165 unsafe {
166- let mut data: Box < Box < FnMut ( String ) > > = Box :: new ( Box :: new ( callback) ) ;
166+ let mut data: Box < Box < dyn FnMut ( String ) > > = Box :: new ( Box :: new ( callback) ) ;
167167 ui_sys:: uiEntryOnChanged (
168168 self . uiEntry ,
169169 Some ( c_callback) ,
170- & mut * data as * mut Box < FnMut ( String ) > as * mut c_void ,
170+ & mut * data as * mut Box < dyn FnMut ( String ) > as * mut c_void ,
171171 ) ;
172172 mem:: forget ( data) ;
173173 }
@@ -177,7 +177,7 @@ impl TextEntry for Entry {
177177 let string = CStr :: from_ptr ( ui_sys:: uiEntryText ( entry) )
178178 . to_string_lossy ( )
179179 . into_owned ( ) ;
180- mem:: transmute :: < * mut c_void , & mut Box < FnMut ( String ) > > ( data) ( string) ;
180+ mem:: transmute :: < * mut c_void , & mut Box < dyn FnMut ( String ) > > ( data) ( string) ;
181181 mem:: forget ( entry) ;
182182 }
183183 }
@@ -199,11 +199,11 @@ impl TextEntry for PasswordEntry {
199199
200200 fn on_changed < ' ctx , F : FnMut ( String ) + ' ctx > ( & mut self , _ctx : & ' ctx UI , callback : F ) {
201201 unsafe {
202- let mut data: Box < Box < FnMut ( String ) > > = Box :: new ( Box :: new ( callback) ) ;
202+ let mut data: Box < Box < dyn FnMut ( String ) > > = Box :: new ( Box :: new ( callback) ) ;
203203 ui_sys:: uiEntryOnChanged (
204204 self . uiEntry ,
205205 Some ( c_callback) ,
206- & mut * data as * mut Box < FnMut ( String ) > as * mut c_void ,
206+ & mut * data as * mut Box < dyn FnMut ( String ) > as * mut c_void ,
207207 ) ;
208208 mem:: forget ( data) ;
209209 }
@@ -213,7 +213,7 @@ impl TextEntry for PasswordEntry {
213213 let string = CStr :: from_ptr ( ui_sys:: uiEntryText ( entry) )
214214 . to_string_lossy ( )
215215 . into_owned ( ) ;
216- mem:: transmute :: < * mut c_void , & mut Box < FnMut ( String ) > > ( data) ( string) ;
216+ mem:: transmute :: < * mut c_void , & mut Box < dyn FnMut ( String ) > > ( data) ( string) ;
217217 mem:: forget ( entry) ;
218218 }
219219 }
@@ -235,11 +235,11 @@ impl TextEntry for MultilineEntry {
235235
236236 fn on_changed < ' ctx , F : FnMut ( String ) + ' ctx > ( & mut self , _ctx : & ' ctx UI , callback : F ) {
237237 unsafe {
238- let mut data: Box < Box < FnMut ( String ) > > = Box :: new ( Box :: new ( callback) ) ;
238+ let mut data: Box < Box < dyn FnMut ( String ) > > = Box :: new ( Box :: new ( callback) ) ;
239239 ui_sys:: uiMultilineEntryOnChanged (
240240 self . uiMultilineEntry ,
241241 Some ( c_callback) ,
242- & mut * data as * mut Box < FnMut ( String ) > as * mut c_void ,
242+ & mut * data as * mut Box < dyn FnMut ( String ) > as * mut c_void ,
243243 ) ;
244244 mem:: forget ( data) ;
245245 }
@@ -249,7 +249,7 @@ impl TextEntry for MultilineEntry {
249249 let string = CStr :: from_ptr ( ui_sys:: uiMultilineEntryText ( entry) )
250250 . to_string_lossy ( )
251251 . into_owned ( ) ;
252- mem:: transmute :: < * mut c_void , & mut Box < FnMut ( String ) > > ( data) ( string) ;
252+ mem:: transmute :: < * mut c_void , & mut Box < dyn FnMut ( String ) > > ( data) ( string) ;
253253 mem:: forget ( entry) ;
254254 }
255255 }
@@ -287,19 +287,19 @@ impl Combobox {
287287
288288 pub fn on_selected < F : FnMut ( i32 ) > ( & mut self , _ctx : & UI , callback : F ) {
289289 unsafe {
290- let mut data: Box < Box < FnMut ( i32 ) > > = Box :: new ( Box :: new ( callback) ) ;
290+ let mut data: Box < Box < dyn FnMut ( i32 ) > > = Box :: new ( Box :: new ( callback) ) ;
291291 ui_sys:: uiComboboxOnSelected (
292292 self . uiCombobox ,
293293 Some ( c_callback) ,
294- & mut * data as * mut Box < FnMut ( i32 ) > as * mut c_void ,
294+ & mut * data as * mut Box < dyn FnMut ( i32 ) > as * mut c_void ,
295295 ) ;
296296 mem:: forget ( data) ;
297297 }
298298
299299 extern "C" fn c_callback ( combobox : * mut uiCombobox , data : * mut c_void ) {
300300 unsafe {
301301 let val = ui_sys:: uiComboboxSelected ( combobox) ;
302- mem:: transmute :: < * mut c_void , & mut Box < FnMut ( i32 ) > > ( data) ( val) ;
302+ mem:: transmute :: < * mut c_void , & mut Box < dyn FnMut ( i32 ) > > ( data) ( val) ;
303303 }
304304 }
305305 }
@@ -328,19 +328,19 @@ impl Checkbox {
328328
329329 pub fn on_toggled < F : FnMut ( bool ) > ( & mut self , _ctx : & UI , callback : F ) {
330330 unsafe {
331- let mut data: Box < Box < FnMut ( bool ) > > = Box :: new ( Box :: new ( callback) ) ;
331+ let mut data: Box < Box < dyn FnMut ( bool ) > > = Box :: new ( Box :: new ( callback) ) ;
332332 ui_sys:: uiCheckboxOnToggled (
333333 self . uiCheckbox ,
334334 Some ( c_callback) ,
335- & mut * data as * mut Box < FnMut ( bool ) > as * mut c_void ,
335+ & mut * data as * mut Box < dyn FnMut ( bool ) > as * mut c_void ,
336336 ) ;
337337 mem:: forget ( data) ;
338338 }
339339
340340 extern "C" fn c_callback ( checkbox : * mut uiCheckbox , data : * mut c_void ) {
341341 unsafe {
342342 let val = ui_sys:: uiCheckboxChecked ( checkbox) != 0 ;
343- mem:: transmute :: < * mut c_void , & mut Box < FnMut ( bool ) > > ( data) ( val) ;
343+ mem:: transmute :: < * mut c_void , & mut Box < dyn FnMut ( bool ) > > ( data) ( val) ;
344344 }
345345 }
346346 }
@@ -372,19 +372,19 @@ impl RadioButtons {
372372
373373 pub fn on_selected < ' ctx , F : FnMut ( i32 ) + ' ctx > ( & self , _ctx : & ' ctx UI , callback : F ) {
374374 unsafe {
375- let mut data: Box < Box < FnMut ( i32 ) > > = Box :: new ( Box :: new ( callback) ) ;
375+ let mut data: Box < Box < dyn FnMut ( i32 ) > > = Box :: new ( Box :: new ( callback) ) ;
376376 ui_sys:: uiRadioButtonsOnSelected (
377377 self . uiRadioButtons ,
378378 Some ( c_callback) ,
379- & mut * data as * mut Box < FnMut ( i32 ) > as * mut c_void ,
379+ & mut * data as * mut Box < dyn FnMut ( i32 ) > as * mut c_void ,
380380 ) ;
381381 mem:: forget ( data) ;
382382 }
383383
384384 extern "C" fn c_callback ( radio_buttons : * mut uiRadioButtons , data : * mut c_void ) {
385385 unsafe {
386386 let val = ui_sys:: uiRadioButtonsSelected ( radio_buttons) ;
387- mem:: transmute :: < * mut c_void , & mut Box < FnMut ( i32 ) > > ( data) ( val) ;
387+ mem:: transmute :: < * mut c_void , & mut Box < dyn FnMut ( i32 ) > > ( data) ( val) ;
388388 }
389389 }
390390 }
0 commit comments