Merge rust-bitcoin/rust-bitcoin#4293: chore: remove needless question mark

89d61304af chore: remove needless question mark (lfgtwo)

Pull request description:

  There’s no reason to use ? to short-circuit when execution of the body will end there anyway.

ACKs for top commit:
  apoelstra:
    ACK 89d61304af8e05757e5ce3d57497ddbef716674e; successfully ran local tests; sure
  Kixunil:
    ACK 89d61304af

Tree-SHA512: ac266c9e1d5104c1cb05488a6f3d8d5710e53a17a678ceff7a8a53f839683c3c55e5d229c2df132b0338580f53340686c0c8c554852787c0ead1225b0ef790fa
This commit is contained in:
merge-script 2025-03-29 00:18:53 +00:00
commit afcfc13333
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
3 changed files with 8 additions and 8 deletions

View File

@ -108,9 +108,9 @@ pub mod as_sat_per_vb_floor {
// Errors on overflow.
pub fn deserialize<'d, D: Deserializer<'d>>(d: D) -> Result<FeeRate, D::Error> {
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<FeeRate, D::Error> {
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 {

View File

@ -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)
}
}

View File

@ -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<u32, ParseIntError> {
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<u32, ParseIntError> {
/// If the input string is not a valid hex encoding of a `u128`.
pub fn hex_u128(s: &str) -> Result<u128, ParseIntError> {
let unchecked = hex_remove_optional_prefix(s);
Ok(hex_u128_unchecked(unchecked)?)
hex_u128_unchecked(unchecked)
}
/// Parses a `u128` from a prefixed hex string.