We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 57d47c8 commit 624bb0bCopy full SHA for 624bb0b
src/range_proof/mod.rs
@@ -570,7 +570,14 @@ impl<'de> Deserialize<'de> for RangeProof {
570
while let Some(elem) = seq.next_element()? {
571
vec.push(elem);
572
}
573
+ // Using Error::custom requires T: Display, which our error
574
+ // type only implements when it implements std::error::Error.
575
+ #[cfg(feature = "std")]
576
return RangeProof::from_bytes(&*vec).map_err(serde::de::Error::custom);
577
+ // In no-std contexts, drop the error message.
578
+ #[cfg(not(feature = "std"))]
579
+ return RangeProof::from_bytes(&*vec)
580
+ .map_err(|_| serde::de::Error::custom("deserialization error"));
581
582
583
fn visit_bytes<E>(self, v: &[u8]) -> Result<RangeProof, E>
0 commit comments