Skip to content

Commit 41199cc

Browse files
authored
Merge pull request #1011 from stepancheg/utf-8
Document to_writer only writes valid UTF-8 strings
2 parents ce53b86 + cd5ed82 commit 41199cc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/ser.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2064,6 +2064,8 @@ static ESCAPE: [u8; 256] = [
20642064

20652065
/// Serialize the given data structure as JSON into the IO stream.
20662066
///
2067+
/// Serialization guarantees it only feeds valid UTF-8 sequences to the writer.
2068+
///
20672069
/// # Errors
20682070
///
20692071
/// Serialization can fail if `T`'s implementation of `Serialize` decides to
@@ -2082,6 +2084,8 @@ where
20822084
/// Serialize the given data structure as pretty-printed JSON into the IO
20832085
/// stream.
20842086
///
2087+
/// Serialization guarantees it only feeds valid UTF-8 sequences to the writer.
2088+
///
20852089
/// # Errors
20862090
///
20872091
/// Serialization can fail if `T`'s implementation of `Serialize` decides to

0 commit comments

Comments
 (0)