Skip to content

Commit 59b6d13

Browse files
author
ass3rt
committed
Removed reimplementations of default methods
The default methods do the exact same thing thus our overrides are useless, potentially even problematic. Credit to Kixunil for this fix: rust-bitcoin/rust-bitcoin#905 (comment)
1 parent a5ce6c1 commit 59b6d13

File tree

2 files changed

+0
-56
lines changed

2 files changed

+0
-56
lines changed

src/blockdata/script.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,20 +1024,6 @@ impl<'de> serde::Deserialize<'de> for Script {
10241024
let v = Vec::from_hex(v).map_err(E::custom)?;
10251025
Ok(Script::from(v))
10261026
}
1027-
1028-
fn visit_borrowed_str<E>(self, v: &'de str) -> Result<Self::Value, E>
1029-
where
1030-
E: serde::de::Error,
1031-
{
1032-
self.visit_str(v)
1033-
}
1034-
1035-
fn visit_string<E>(self, v: String) -> Result<Self::Value, E>
1036-
where
1037-
E: serde::de::Error,
1038-
{
1039-
self.visit_str(&v)
1040-
}
10411027
}
10421028
deserializer.deserialize_str(Visitor)
10431029
} else {

src/internal_macros.rs

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -152,20 +152,6 @@ macro_rules! serde_string_impl {
152152
{
153153
$name::from_str(v).map_err(E::custom)
154154
}
155-
156-
fn visit_borrowed_str<E>(self, v: &'de str) -> Result<Self::Value, E>
157-
where
158-
E: $crate::serde::de::Error,
159-
{
160-
self.visit_str(v)
161-
}
162-
163-
fn visit_string<E>(self, v: $crate::prelude::String) -> Result<Self::Value, E>
164-
where
165-
E: $crate::serde::de::Error,
166-
{
167-
self.visit_str(&v)
168-
}
169155
}
170156

171157
deserializer.deserialize_str(Visitor)
@@ -215,19 +201,6 @@ macro_rules! serde_struct_human_string_impl {
215201
$name::from_str(v).map_err(E::custom)
216202
}
217203

218-
fn visit_borrowed_str<E>(self, v: &'de str) -> Result<Self::Value, E>
219-
where
220-
E: $crate::serde::de::Error,
221-
{
222-
self.visit_str(v)
223-
}
224-
225-
fn visit_string<E>(self, v: $crate::prelude::String) -> Result<Self::Value, E>
226-
where
227-
E: $crate::serde::de::Error,
228-
{
229-
self.visit_str(&v)
230-
}
231204
}
232205

233206
deserializer.deserialize_str(Visitor)
@@ -573,21 +546,6 @@ macro_rules! user_enum {
573546
Err(E::unknown_variant(v, FIELDS))
574547
}
575548
}
576-
577-
fn visit_borrowed_str<E>(self, v: &'de str) -> Result<Self::Value, E>
578-
where
579-
E: $crate::serde::de::Error,
580-
{
581-
self.visit_str(v)
582-
}
583-
584-
fn visit_string<E>(self, v: $crate::prelude::String) -> Result<Self::Value, E>
585-
where
586-
E: $crate::serde::de::Error,
587-
{
588-
self.visit_str(&v)
589-
}
590-
591549
}
592550

593551
deserializer.deserialize_str(Visitor)

0 commit comments

Comments
 (0)