diff --git a/Cargo.toml b/Cargo.toml index 030282f3e..553949857 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "serde_json" -version = "1.0.95" # remember to update html_root_url +version = "1.0.96" # remember to update html_root_url authors = ["Erick Tryzelaar ", "David Tolnay "] categories = ["encoding", "parser-implementations", "no-std"] description = "A JSON serialization file format" diff --git a/src/lib.rs b/src/lib.rs index 95242d40b..637d1ce2f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -300,7 +300,7 @@ //! [macro]: crate::json //! [`serde-json-core`]: https://github.com/rust-embedded-community/serde-json-core -#![doc(html_root_url = "https://docs.rs/serde_json/1.0.95")] +#![doc(html_root_url = "https://docs.rs/serde_json/1.0.96")] // Ignored clippy lints #![allow( clippy::collapsible_else_if, 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 diff --git a/tests/regression/issue1004.rs b/tests/regression/issue1004.rs index 3f5bd96aa..c09fb9610 100644 --- a/tests/regression/issue1004.rs +++ b/tests/regression/issue1004.rs @@ -3,7 +3,7 @@ #[test] fn test() { let float = 5.55f32; - let value = serde_json::to_value(&float).unwrap(); + let value = serde_json::to_value(float).unwrap(); let json = serde_json::to_string(&value).unwrap(); // If the f32 were cast to f64 by Value before serialization, then this