mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-10-21 11:16:29 +00:00
Enable deserializing an empty String from a unit value
This commit is contained in:
1 parent
de6d00c306
commit
d63d09f4db
1 file changed
+6
@@ -283,6 +283,12 @@ impl Visitor for StringVisitor {
|
||||
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>
|
||||
where E: Error,
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user