Merge pull request #635 from serde-rs/oli-obk-patch-1

Enable deserializing an empty `String` from a unit value
This commit is contained in:
David Tolnay
2016-12-01 07:46:07 -05:00
committed by GitHub
+6
View File
@@ -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,
{