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,