Skip to content

Commit

Permalink
Simpler bool
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Jan 7, 2025
1 parent 433f35e commit 9b733ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
7 changes: 1 addition & 6 deletions security-framework/src/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,12 +367,7 @@ impl ItemSearchOptions {
if let Some(ref trusted_only) = self.trusted_only {
params.add(
&kSecMatchTrustedOnly.to_void(),
&(if *trusted_only {
CFBoolean::true_value()
} else {
CFBoolean::false_value()
})
.to_void(),
&CFBoolean::from(*trusted_only).to_void(),
);
}

Expand Down
9 changes: 2 additions & 7 deletions security-framework/src/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -518,13 +518,8 @@ impl GenerateKeyOptions {
#[cfg(feature = "sync-keychain")]
if let Some(ref synchronizable) = self.synchronizable {
attribute_key_values.push((
unsafe { kSecAttrSynchronizable }.to_void(),
(if *synchronizable {
CFBoolean::true_value()
} else {
CFBoolean::false_value()
})
.to_void(),
unsafe { security_framework_sys::item::kSecAttrSynchronizable }.to_void(),
CFBoolean::from(*synchronizable).to_void(),
));
}

Expand Down

0 comments on commit 9b733ff

Please sign in to comment.