Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(serde): remove deprecated num module #1350

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/rpc-types-eth/src/fee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ pub struct FeeHistory {
serde(
default,
skip_serializing_if = "Option::is_none",
with = "alloy_serde::u128_vec_vec_opt_via_ruint"
with = "alloy_serde::quantity::u128_vec_vec_opt"
)
)]
pub reward: Option<Vec<Vec<u128>>>,
Expand Down
5 changes: 0 additions & 5 deletions crates/serde/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ pub use self::bool::*;
mod optional;
pub use self::optional::*;

#[cfg_attr(not(test), deprecated = "use `quantity::{self, opt, vec}` instead")]
pub mod num;
#[allow(deprecated)]
pub use num::*;

pub mod quantity;

/// Storage related helpers.
Expand Down
307 changes: 0 additions & 307 deletions crates/serde/src/num.rs

This file was deleted.

4 changes: 2 additions & 2 deletions crates/serde/src/optional.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! Serde functions for encoding optional values.

use serde::{Deserialize, Deserializer};

/// For use with serde's `deserialize_with` on a sequence that must be
Expand All @@ -8,6 +9,5 @@ where
T: Deserialize<'de> + Default,
D: Deserializer<'de>,
{
let s: Option<T> = Deserialize::deserialize(deserializer)?;
Ok(s.unwrap_or_default())
Option::<T>::deserialize(deserializer).map(Option::unwrap_or_default)
}
Loading