Skip to content

Commit

Permalink
Merge pull request #1014 from peterdelevoryas/main
Browse files Browse the repository at this point in the history
➕ zb,zv: Add camino feature to impl `Type` for utf-8 path types
  • Loading branch information
zeenix authored Sep 23, 2024
2 parents 9fc6c2b + 864e9c5 commit be53edb
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions zbus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ chrono = ["zvariant/chrono"]
heapless = ["zvariant/heapless"]
# Enables ser/de of `Option<T>` as an array of 0 or 1 elements.
option-as-array = ["zvariant/option-as-array"]
camino = ["zvariant/camino"]
# Enables API that is only needed for bus implementations (enables `p2p`).
bus-impl = ["p2p"]
# Enables API that is only needed for peer-to-peer (p2p) connections.
Expand Down
2 changes: 2 additions & 0 deletions zvariant/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ gvariant = ["zvariant_derive/gvariant", "zvariant_utils/gvariant"]
ostree-tests = ["gvariant"]
# Enables ser/de of `Option<T>` as an array of 0 or 1 elements.
option-as-array = []
camino = ["dep:camino"]

[dependencies]
zvariant_derive = { version = "=4.2.0", path = "../zvariant_derive" }
Expand All @@ -39,6 +40,7 @@ chrono = { version = "0.4.38", features = [
"serde",
], default-features = false, optional = true }
heapless = { version = "0.8.0", features = ["serde"], optional = true }
camino = { version = "1.1.9", optional = true }

[dev-dependencies]
serde_json = "1.0.116"
Expand Down
5 changes: 5 additions & 0 deletions zvariant/src/type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,11 @@ macro_rules! static_str_type {
static_str_type!(Path);
static_str_type!(PathBuf);

#[cfg(feature = "camino")]
static_str_type!(camino::Utf8Path);
#[cfg(feature = "camino")]
static_str_type!(camino::Utf8PathBuf);

#[cfg(feature = "uuid")]
impl_type_with_repr! {
uuid::Uuid => &[u8] {
Expand Down

0 comments on commit be53edb

Please sign in to comment.