Skip to content

Commit 9b733ff

Browse files
committed
Simpler bool
1 parent 433f35e commit 9b733ff

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

security-framework/src/item.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -367,12 +367,7 @@ impl ItemSearchOptions {
367367
if let Some(ref trusted_only) = self.trusted_only {
368368
params.add(
369369
&kSecMatchTrustedOnly.to_void(),
370-
&(if *trusted_only {
371-
CFBoolean::true_value()
372-
} else {
373-
CFBoolean::false_value()
374-
})
375-
.to_void(),
370+
&CFBoolean::from(*trusted_only).to_void(),
376371
);
377372
}
378373

security-framework/src/key.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -518,13 +518,8 @@ impl GenerateKeyOptions {
518518
#[cfg(feature = "sync-keychain")]
519519
if let Some(ref synchronizable) = self.synchronizable {
520520
attribute_key_values.push((
521-
unsafe { kSecAttrSynchronizable }.to_void(),
522-
(if *synchronizable {
523-
CFBoolean::true_value()
524-
} else {
525-
CFBoolean::false_value()
526-
})
527-
.to_void(),
521+
unsafe { security_framework_sys::item::kSecAttrSynchronizable }.to_void(),
522+
CFBoolean::from(*synchronizable).to_void(),
528523
));
529524
}
530525

0 commit comments

Comments
 (0)