From 89d61304af8e05757e5ce3d57497ddbef716674e Mon Sep 17 00:00:00 2001 From: lfgtwo Date: Sat, 29 Mar 2025 01:00:06 +0800 Subject: [PATCH] chore: remove needless question mark --- units/src/fee_rate/serde.rs | 8 ++++---- units/src/locktime/absolute.rs | 4 ++-- units/src/parse.rs | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/units/src/fee_rate/serde.rs b/units/src/fee_rate/serde.rs index 1b1ad3364..fdcb4d67e 100644 --- a/units/src/fee_rate/serde.rs +++ b/units/src/fee_rate/serde.rs @@ -108,9 +108,9 @@ pub mod as_sat_per_vb_floor { // Errors on overflow. pub fn deserialize<'d, D: Deserializer<'d>>(d: D) -> Result { - Ok(FeeRate::from_sat_per_vb(u64::deserialize(d)?) + FeeRate::from_sat_per_vb(u64::deserialize(d)?) .ok_or(OverflowError) - .map_err(serde::de::Error::custom)?) + .map_err(serde::de::Error::custom) } pub mod opt { @@ -184,9 +184,9 @@ pub mod as_sat_per_vb_ceil { // Errors on overflow. pub fn deserialize<'d, D: Deserializer<'d>>(d: D) -> Result { - Ok(FeeRate::from_sat_per_vb(u64::deserialize(d)?) + FeeRate::from_sat_per_vb(u64::deserialize(d)?) .ok_or(OverflowError) - .map_err(serde::de::Error::custom)?) + .map_err(serde::de::Error::custom) } pub mod opt { diff --git a/units/src/locktime/absolute.rs b/units/src/locktime/absolute.rs index fbc842fb7..698516078 100644 --- a/units/src/locktime/absolute.rs +++ b/units/src/locktime/absolute.rs @@ -111,7 +111,7 @@ impl<'de> serde::Deserialize<'de> for Height { D: serde::Deserializer<'de>, { let u = u32::deserialize(deserializer)?; - Ok(Height::from_consensus(u).map_err(serde::de::Error::custom)?) + Height::from_consensus(u).map_err(serde::de::Error::custom) } } @@ -191,7 +191,7 @@ impl<'de> serde::Deserialize<'de> for Time { D: serde::Deserializer<'de>, { let u = u32::deserialize(deserializer)?; - Ok(Time::from_consensus(u).map_err(serde::de::Error::custom)?) + Time::from_consensus(u).map_err(serde::de::Error::custom) } } diff --git a/units/src/parse.rs b/units/src/parse.rs index 3e6e34a52..9c0a6ca6b 100644 --- a/units/src/parse.rs +++ b/units/src/parse.rs @@ -284,7 +284,7 @@ pub fn hex_check_unprefixed(s: &str) -> Result<&str, UnprefixedHexError> { /// If the input string is not a valid hex encoding of a `u32`. pub fn hex_u32(s: &str) -> Result { let unchecked = hex_remove_optional_prefix(s); - Ok(hex_u32_unchecked(unchecked)?) + hex_u32_unchecked(unchecked) } /// Parses a `u32` from a prefixed hex string. @@ -333,7 +333,7 @@ pub fn hex_u32_unchecked(s: &str) -> Result { /// If the input string is not a valid hex encoding of a `u128`. pub fn hex_u128(s: &str) -> Result { let unchecked = hex_remove_optional_prefix(s); - Ok(hex_u128_unchecked(unchecked)?) + hex_u128_unchecked(unchecked) } /// Parses a `u128` from a prefixed hex string.