Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update typed-builder dependency #18

Merged
merged 1 commit into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ nrf-hal-common = { version = "0.15.0", optional = true }
rand = { version = "0.8.5", optional = true, default-features = false }
serde = { version = "1.0.185", default-features = false, features = ["derive"], optional = true }
serde_bytes = { version = "0.11.14", optional = true, default-features = false }
typed-builder = { version = "0.18.0", optional = true }
typed-builder = { version = "0.20.0", optional = true }

[features]
default = ["aes-session"]
Expand Down
4 changes: 2 additions & 2 deletions generate_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,13 @@ def flatten(items):

if "maybe_p1_mask" in v:
a = v["maybe_p1_mask"]
outfile.write(" #[cfg_attr(feature = \"builder\", builder(default, setter(strip_option)))]\n")
outfile.write(f' #[cfg_attr(feature = "builder", builder(default, setter(strip_option(fallback = {a["name"] + "_opt"}))))]\n')
outfile.write(f' pub {a["name"]}: Option<{a["type"]}>,\n')
pre_ins += f' let p1: u8 = self.{a["name"]}.map(|v| v | {p1_val} ).unwrap_or({p1});\n'
p1_val = "p1"
if "maybe_p2_mask" in v:
a = v["maybe_p2_mask"]
outfile.write(" #[cfg_attr(feature = \"builder\", builder(default, setter(strip_option)))]\n")
outfile.write(f' #[cfg_attr(feature = "builder", builder(default, setter(strip_option(fallback = {a["name"] + "_opt"}))))]\n')
outfile.write(f' pub {a["name"]}: Option<{a["type"]}>,\n')
pre_ins += f' let p2: u8 = self.{a["name"]}.map(|v| v | {p2_val} ).unwrap_or({p2});\n'
p2_val = "p2"
Expand Down
6 changes: 3 additions & 3 deletions src/se05x/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ pub struct WriteEcKey<'data> {
pub transient: bool,
#[cfg_attr(feature = "builder", builder(default))]
pub is_auth: bool,
#[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
#[cfg_attr(feature = "builder", builder(default, setter(strip_option(fallback = key_type_opt))))]
pub key_type: Option<P1KeyType>,
/// Serialized to TLV tag [`TAG_POLICY`]()
#[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
Expand Down Expand Up @@ -570,9 +570,9 @@ pub struct WriteRsaKey<'data> {
pub transient: bool,
#[cfg_attr(feature = "builder", builder(default))]
pub is_auth: bool,
#[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
#[cfg_attr(feature = "builder", builder(default, setter(strip_option(fallback = key_type_opt))))]
pub key_type: Option<P1KeyType>,
#[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
#[cfg_attr(feature = "builder", builder(default, setter(strip_option(fallback = key_format_opt))))]
pub key_format: Option<RsaFormat>,
/// Serialized to TLV tag [`TAG_POLICY`]()
#[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
Expand Down