diff --git a/src/de.rs b/src/de.rs index 5b64138d8..b1f4b84c3 100644 --- a/src/de.rs +++ b/src/de.rs @@ -2568,6 +2568,7 @@ where /// /// use std::error::Error; /// use std::net::{TcpListener, TcpStream}; +/// use std::io::BufReader; /// /// #[derive(Deserialize, Debug)] /// struct User { @@ -2576,7 +2577,8 @@ where /// } /// /// fn read_user_from_stream(tcp_stream: TcpStream) -> Result> { -/// let mut de = serde_json::Deserializer::from_reader(tcp_stream); +/// let buf_tcp_stream = BufReader::new(tcp_stream); +/// let mut de = serde_json::Deserializer::from_reader(buf_tcp_stream); /// let u = User::deserialize(&mut de)?; /// /// Ok(u)