Skip to content

Commit

Permalink
Merge pull request #18 from Nitrokey/update-deps
Browse files Browse the repository at this point in the history
Update typed-builder dependency
  • Loading branch information
sosthene-nitrokey authored Oct 1, 2024
2 parents 6fe7863 + 65c10bb commit 1e379a5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
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

0 comments on commit 1e379a5

Please sign in to comment.