Skip to content

Commit

Permalink
feat(registry): Derive Serialize and Deserialize on registry types (#179
Browse files Browse the repository at this point in the history
)
  • Loading branch information
GaspardCulis authored Nov 3, 2024
1 parent 6b0fe5b commit 0774888
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Cargo.lock

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

3 changes: 2 additions & 1 deletion azalea-registry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ simdnbt = "0.6"
azalea-buf = { path = "../azalea-buf", version = "0.10.0" }
azalea-registry-macros = { path = "./azalea-registry-macros", version = "0.10.0" }
once_cell = "1.19.0"
serde = { version = "^1.0", optional = true }
[features]
serde = ["azalea-registry-macros/serde"]
serde = ["azalea-registry-macros/serde", "dep:serde"]
default = ["serde"]
1 change: 1 addition & 0 deletions azalea-registry/azalea-registry-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ pub fn registry(input: TokenStream) -> TokenStream {
generated.extend(quote! {
#(#attributes)*
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, azalea_buf::McBuf, simdnbt::ToNbtTag, simdnbt::FromNbtTag)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
#[repr(u32)]
pub enum #name {
#enum_items
Expand Down

0 comments on commit 0774888

Please sign in to comment.