Enable deserializing an empty String from a unit value

This commit is contained in:
Oliver Schneider 2016-12-01 11:23:12 +01:00 committed by GitHub
parent de6d00c306
commit d63d09f4db

View File

@ -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,
{ {