File tree 1 file changed +7
-7
lines changed
1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -232,20 +232,20 @@ where
232
232
} )
233
233
. collect ( ) ;
234
234
let result = unsafe {
235
+ let scheme = scheme. map ( |scheme| sys:: SDL_MessageBoxColorScheme {
236
+ colors : scheme. into ( ) ,
237
+ } ) ;
235
238
let msg_box_data = sys:: SDL_MessageBoxData {
236
239
flags : flags. bits ( ) ,
237
240
window : window. map_or ( ptr:: null_mut ( ) , |win| win. raw ( ) ) ,
238
241
title : title. as_ptr ( ) as * const c_char ,
239
242
message : message. as_ptr ( ) as * const c_char ,
240
243
numbuttons : raw_buttons. len ( ) as c_int ,
241
244
buttons : raw_buttons. as_ptr ( ) ,
242
- colorScheme : if let Some ( scheme) = scheme {
243
- & sys:: SDL_MessageBoxColorScheme {
244
- colors : From :: from ( scheme) ,
245
- } as * const _
246
- } else {
247
- ptr:: null ( )
248
- } ,
245
+ colorScheme : scheme
246
+ . as_ref ( )
247
+ . map ( |p| p as * const _ )
248
+ . unwrap_or ( ptr:: null ( ) ) ,
249
249
} ;
250
250
sys:: SDL_ShowMessageBox ( & msg_box_data as * const _ , & mut button_id as & mut _ )
251
251
} == 0 ;
You can’t perform that action at this time.
0 commit comments