From cd5ed8204a22cf2b9fd2ea2b20956909b8ac1f4a Mon Sep 17 00:00:00 2001 From: Stiopa Koltsov Date: Wed, 12 Apr 2023 12:40:35 +0100 Subject: [PATCH] Document to_writer only writes valid UTF-8 strings --- src/ser.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ser.rs b/src/ser.rs index 80c2deb0c..b38f3486b 100644 --- a/src/ser.rs +++ b/src/ser.rs @@ -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 @@ -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