serde: Relax bounds on Raw::deserialize_as
This commit is contained in:
parent
1562cd1d3a
commit
f0e3a39706
@ -126,6 +126,14 @@ impl<T> Raw<T> {
|
||||
let mut deserializer = serde_json::Deserializer::from_str(self.json().get());
|
||||
deserializer.deserialize_map(SingleFieldVisitor::new(field_name))
|
||||
}
|
||||
|
||||
/// Try to deserialize the JSON as a custom type.
|
||||
pub fn deserialize_as<U>(&self) -> serde_json::Result<U>
|
||||
where
|
||||
U: DeserializeOwned,
|
||||
{
|
||||
serde_json::from_str(self.json.get())
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Raw<T>
|
||||
@ -136,14 +144,6 @@ where
|
||||
pub fn deserialize(&self) -> serde_json::Result<T> {
|
||||
serde_json::from_str(self.json.get())
|
||||
}
|
||||
|
||||
/// Try to deserialize the JSON as a custom type.
|
||||
pub fn deserialize_as<U>(&self) -> serde_json::Result<U>
|
||||
where
|
||||
U: DeserializeOwned,
|
||||
{
|
||||
serde_json::from_str(self.json.get())
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Serialize> From<&T> for Raw<T> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user