From 4d10eef55df49ba3d5f7b834750592f27800d0f7 Mon Sep 17 00:00:00 2001 From: Erick Tryzelaar Date: Sun, 21 Feb 2016 16:03:33 -0800 Subject: [PATCH] doc(serde): Document the visit_string method Closes #184 --- serde/src/de/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/serde/src/de/mod.rs b/serde/src/de/mod.rs index 3d172a06..11050648 100644 --- a/serde/src/de/mod.rs +++ b/serde/src/de/mod.rs @@ -541,7 +541,9 @@ pub trait Visitor { Err(Error::type_mismatch(Type::Str)) } - /// `visit_string` deserializes a `String` into a `Value`. + /// `visit_string` deserializes a `String` into a `Value`. This allows a deserializer to avoid + /// a copy if it is deserializing a string from a `String` type. By default it passes a `&str` + /// to the `visit_str` method. #[inline] fn visit_string(&mut self, v: String) -> Result where E: Error,