mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-24 22:47:58 +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)
|
||||
}
|
||||
|
||||
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