Skip to content

Commit

Permalink
Fix example of from_reader not applying buffering when it should
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanBrouwer committed Jan 28, 2025
1 parent 87f78da commit 65bbd1a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2568,6 +2568,7 @@ where
///
/// use std::error::Error;
/// use std::net::{TcpListener, TcpStream};
/// use std::io::BufReader;
///
/// #[derive(Deserialize, Debug)]
/// struct User {
Expand All @@ -2576,7 +2577,8 @@ where
/// }
///
/// fn read_user_from_stream(tcp_stream: TcpStream) -> Result<User, Box<dyn Error>> {
/// 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)
Expand Down

0 comments on commit 65bbd1a

Please sign in to comment.