diff --git a/crates/serde/src/num.rs b/crates/serde/src/num.rs index e8cd4e626396..5842a03c3179 100644 --- a/crates/serde/src/num.rs +++ b/crates/serde/src/num.rs @@ -72,7 +72,7 @@ impl<'de> Deserialize<'de> for U64HexOrNumber { } } -/// serde functions for handling `u8` as [U8] +/// serde functions for handling `u8` as [U8](alloy_primitives::U8) pub mod u8_hex { use alloy_primitives::U8; use serde::{Deserialize, Deserializer, Serialize, Serializer}; @@ -91,7 +91,7 @@ pub mod u8_hex { } } -/// serde functions for handling `Option` as [U8] +/// serde functions for handling `Option` as [U8](alloy_primitives::U8) pub mod u8_hex_opt { use alloy_primitives::U8; use serde::{Deserialize, Deserializer, Serialize, Serializer}; @@ -244,12 +244,12 @@ where NumberOrHexU256::deserialize(deserializer)?.try_into_u256() } -/// serde functions for handling primitive `u128` as [U128] +/// serde functions for handling primitive `u128` as [U128](alloy_primitives::U128) pub mod u128_hex_or_decimal { use alloy_primitives::U128; use serde::{Deserialize, Deserializer, Serialize, Serializer}; - /// Deserializes an `u64` accepting a hex quantity string with optional 0x prefix or + /// Deserializes an `u128` accepting a hex quantity string with optional 0x prefix or /// a number pub fn deserialize<'de, D>(deserializer: D) -> Result where @@ -258,7 +258,7 @@ pub mod u128_hex_or_decimal { U128::deserialize(deserializer).map(|val| val.to()) } - /// Serializes u64 as hex string + /// Serializes u128 as hex string pub fn serialize(value: &u128, s: S) -> Result { U128::from(*value).serialize(s) }