Skip to content

Commit

Permalink
Merge pull request #1011 from stepancheg/utf-8
Browse files Browse the repository at this point in the history
Document to_writer only writes valid UTF-8 strings
  • Loading branch information
dtolnay authored Apr 12, 2023
2 parents ce53b86 + cd5ed82 commit 41199cc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2064,6 +2064,8 @@ static ESCAPE: [u8; 256] = [

/// Serialize the given data structure as JSON into the IO stream.
///
/// Serialization guarantees it only feeds valid UTF-8 sequences to the writer.
///
/// # Errors
///
/// Serialization can fail if `T`'s implementation of `Serialize` decides to
Expand All @@ -2082,6 +2084,8 @@ where
/// Serialize the given data structure as pretty-printed JSON into the IO
/// stream.
///
/// Serialization guarantees it only feeds valid UTF-8 sequences to the writer.
///
/// # Errors
///
/// Serialization can fail if `T`'s implementation of `Serialize` decides to
Expand Down

0 comments on commit 41199cc

Please sign in to comment.