@@ -327,20 +327,12 @@ impl TryFrom<&SecurityDescriptor> for RawSecurityDescriptor {
327
327
fn try_from ( value : & SecurityDescriptor ) -> std:: result:: Result < Self , Self :: Error > {
328
328
let owner = value. owner . as_ref ( ) . map ( RawSid :: try_from) . transpose ( ) ?;
329
329
let group = value. group . as_ref ( ) . map ( RawSid :: try_from) . transpose ( ) ?;
330
- let sacl = value
331
- . sacl
332
- . as_ref ( )
333
- . map ( |x| x. acl . to_raw ( ) . map ( |y| ( x. kind , y) ) )
334
- . transpose ( ) ?;
330
+ let sacl = value. sacl . as_ref ( ) . map ( |x| x. acl . to_raw ( ) ) . transpose ( ) ?;
335
331
336
- let dacl = value
337
- . dacl
338
- . as_ref ( )
339
- . map ( |x| x. acl . to_raw ( ) . map ( |y| ( x. kind , y) ) )
340
- . transpose ( ) ?;
332
+ let dacl = value. dacl . as_ref ( ) . map ( |x| x. acl . to_raw ( ) ) . transpose ( ) ?;
341
333
342
334
let mut control = SECURITY_DESCRIPTOR_CONTROL ( 0 ) ;
343
- if let Some ( ( kind, _ ) ) = sacl {
335
+ if let Some ( kind) = value . sacl . as_ref ( ) . map ( |x| x . kind ) {
344
336
control |= SE_SACL_PRESENT ;
345
337
346
338
control |= match kind {
@@ -350,7 +342,7 @@ impl TryFrom<&SecurityDescriptor> for RawSecurityDescriptor {
350
342
} ;
351
343
}
352
344
353
- if let Some ( ( kind, _ ) ) = dacl {
345
+ if let Some ( kind) = value . dacl . as_ref ( ) . map ( |x| x . kind ) {
354
346
control |= SE_DACL_PRESENT ;
355
347
356
348
control |= match kind {
@@ -371,17 +363,17 @@ impl TryFrom<&SecurityDescriptor> for RawSecurityDescriptor {
371
363
Group : group. as_ref ( ) . map ( RawSid :: as_psid) . unwrap_or_default ( ) ,
372
364
Sacl : sacl
373
365
. as_ref ( )
374
- . map_or_else ( ptr:: null_mut, |x| x. 1 . as_ptr ( ) . cast_mut ( ) . cast ( ) ) ,
366
+ . map_or_else ( ptr:: null_mut, |x| x. as_ptr ( ) . cast_mut ( ) . cast ( ) ) ,
375
367
Dacl : dacl
376
368
. as_ref ( )
377
- . map_or_else ( ptr:: null_mut, |x| x. 1 . as_ptr ( ) . cast_mut ( ) . cast ( ) ) ,
369
+ . map_or_else ( ptr:: null_mut, |x| x. as_ptr ( ) . cast_mut ( ) . cast ( ) ) ,
378
370
} ;
379
371
380
372
Ok ( Self {
381
373
_owner : owner,
382
374
_group : group,
383
- _sacl : sacl. map ( |x| x . 1 ) ,
384
- _dacl : dacl. map ( |x| x . 1 ) ,
375
+ _sacl : sacl,
376
+ _dacl : dacl,
385
377
raw,
386
378
} )
387
379
}
0 commit comments