Skip to content

Commit

Permalink
fix ItemStack
Browse files Browse the repository at this point in the history
  • Loading branch information
JieningYu committed Mar 7, 2024
1 parent 5d4fe43 commit 73ef710
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions crates/core/item/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ rimecraft-nbt-ext = { path = "../../util/nbt-ext" }
serde = { version = "1.0", optional = true, features = ["derive"] }

[features]
# default = ["serde"]
serde = [
"dep:serde",
"rimecraft-registry/serde",
Expand Down
8 changes: 4 additions & 4 deletions crates/core/item/src/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ mod serde_helper {
}

#[inline]
pub fn ser_attachments<K, P, S>(
pub fn ser_attachments<K, Cx, S>(
attachments: &(Attachments<K>, PhantomData<Cx>),
serializer: S,
) -> Result<S::Ok, S::Error>
Expand All @@ -249,7 +249,7 @@ mod serde_helper {
serde::Serialize::serialize(&attachments.0, serializer)
}

pub fn deser_attachments<'de, K, P, D>(
pub fn deser_attachments<'de, K, Cx, D>(
deserializer: D,
) -> Result<(Attachments<K>, PhantomData<Cx>), <D as serde::Deserializer<'de>>::Error>
where
Expand All @@ -274,7 +274,7 @@ mod serde_helper {
use super::*;

#[inline]
pub fn serialize<K, P, S>(item: &Item<'_, K, Cx>, serializer: S) -> Result<S::Ok, S::Error>
pub fn serialize<K, Cx, S>(item: &Item<'_, K, Cx>, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
K: Serialize + Hash + Eq,
Expand All @@ -283,7 +283,7 @@ mod serde_helper {
}

#[inline]
pub fn deserialize<'rr, 'd, K, P, D>(deserializer: D) -> Result<Item<'rr, K, Cx>, D::Error>
pub fn deserialize<'rr, 'd, K, Cx, D>(deserializer: D) -> Result<Item<'rr, K, Cx>, D::Error>
where
'rr: 'd,
D: serde::Deserializer<'d>,
Expand Down

0 comments on commit 73ef710

Please sign in to comment.