mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-12 22:31:02 +00:00
Enable deserializing an empty String from a unit value
This commit is contained in:
@@ -283,6 +283,12 @@ impl Visitor for StringVisitor {
|
|||||||
Ok(v)
|
Ok(v)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn visit_unit<E>(&mut self) -> Result<String, E>
|
||||||
|
where E: Error,
|
||||||
|
{
|
||||||
|
Ok(String::new())
|
||||||
|
}
|
||||||
|
|
||||||
fn visit_bytes<E>(&mut self, v: &[u8]) -> Result<String, E>
|
fn visit_bytes<E>(&mut self, v: &[u8]) -> Result<String, E>
|
||||||
where E: Error,
|
where E: Error,
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user