Skip to content

Commit

Permalink
🚸zd: Allow zbus attribute in macros.
Browse files Browse the repository at this point in the history
Needed to resolve #807.
  • Loading branch information
turbocool3r committed Sep 15, 2024
1 parent 1f12bf6 commit c125ce2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions zvariant_derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ mod value;
/// [`Serialize`]: https://docs.serde.rs/serde/trait.Serialize.html
/// [`Deserialize`]: https://docs.serde.rs/serde/de/trait.Deserialize.html
/// [serde_repr]: https://crates.io/crates/serde_repr
#[proc_macro_derive(Type, attributes(zvariant))]
#[proc_macro_derive(Type, attributes(zbus, zvariant))]
pub fn type_macro_derive(input: TokenStream) -> TokenStream {
let ast: DeriveInput = syn::parse(input).unwrap();
r#type::expand_derive(ast)
Expand Down Expand Up @@ -227,7 +227,7 @@ pub fn type_macro_derive(input: TokenStream) -> TokenStream {
/// * `"kebab-case"`
///
/// [`Serialize`]: https://docs.serde.rs/serde/trait.Serialize.html
#[proc_macro_derive(SerializeDict, attributes(zvariant))]
#[proc_macro_derive(SerializeDict, attributes(zbus, zvariant))]
pub fn serialize_dict_macro_derive(input: TokenStream) -> TokenStream {
let input: DeriveInput = syn::parse(input).unwrap();
dict::expand_serialize_derive(input)
Expand Down Expand Up @@ -296,7 +296,7 @@ pub fn serialize_dict_macro_derive(input: TokenStream) -> TokenStream {
/// * `"kebab-case"`
///
/// [`Deserialize`]: https://docs.serde.rs/serde/de/trait.Deserialize.html
#[proc_macro_derive(DeserializeDict, attributes(zvariant))]
#[proc_macro_derive(DeserializeDict, attributes(zbus, zvariant))]
pub fn deserialize_dict_macro_derive(input: TokenStream) -> TokenStream {
let input: DeriveInput = syn::parse(input).unwrap();
dict::expand_deserialize_derive(input)
Expand Down
2 changes: 1 addition & 1 deletion zvariant_derive/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub fn zvariant_path() -> TokenStream {
}

def_attrs! {
crate zvariant;
crate zbus, zvariant;

/// Attributes defined on structures.
pub StructAttributes("struct") { signature str, rename_all str, deny_unknown_fields none };
Expand Down

0 comments on commit c125ce2

Please sign in to comment.