Merge pull request #544 from est31/master
Add note about issue 160 to from_reader function
diff --git a/Cargo.toml b/Cargo.toml
index ea1472e..af5db9a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "serde_json"
-version = "1.0.39" # remember to update html_root_url
+version = "1.0.40" # remember to update html_root_url
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"]
license = "MIT OR Apache-2.0"
description = "A JSON serialization file format"
@@ -19,7 +19,7 @@
serde = "1.0.60"
indexmap = { version = "1.0", optional = true }
itoa = "0.4.3"
-ryu = "0.2"
+ryu = "1.0"
[dev-dependencies]
automod = "0.1"
diff --git a/src/lib.rs b/src/lib.rs
index 955b1e3..fc84646 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -291,7 +291,8 @@
//! [macro]: https://docs.serde.rs/serde_json/macro.json.html
//! [`serde-json-core`]: https://japaric.github.io/serde-json-core/serde_json_core/
-#![doc(html_root_url = "https://docs.rs/serde_json/1.0.39")]
+#![doc(html_root_url = "https://docs.rs/serde_json/1.0.40")]
+#![allow(unknown_lints, bare_trait_objects, ellipsis_inclusive_range_patterns)]
#![cfg_attr(feature = "cargo-clippy", allow(renamed_and_removed_lints))]
#![cfg_attr(feature = "cargo-clippy", deny(clippy, clippy_pedantic))]
// Ignored clippy lints
@@ -304,6 +305,8 @@
cast_possible_wrap,
cast_precision_loss,
cast_sign_loss,
+ // correctly used
+ integer_division,
// things are often more readable this way
cast_lossless,
module_name_repetitions,
@@ -312,6 +315,7 @@
use_self,
zero_prefixed_literal,
// we support older compilers
+ checked_conversions,
redundant_field_names,
))]
#![deny(missing_docs)]
diff --git a/src/number.rs b/src/number.rs
index 70a8f6d..fd2707a 100644
--- a/src/number.rs
+++ b/src/number.rs
@@ -237,7 +237,7 @@
}
#[cfg(feature = "arbitrary_precision")]
{
- ryu::Buffer::new().format(f).to_owned()
+ ryu::Buffer::new().format_finite(f).to_owned()
}
};
Some(Number { n: n })
@@ -473,7 +473,7 @@
} else if let Some(i) = self.as_i64() {
return visitor.visit_i64(i);
} else if let Some(f) = self.as_f64() {
- if ryu::Buffer::new().format(f) == self.n || f.to_string() == self.n {
+ if ryu::Buffer::new().format_finite(f) == self.n || f.to_string() == self.n {
return visitor.visit_f64(f);
}
}
diff --git a/src/raw.rs b/src/raw.rs
index fe9e246..90ef59b 100644
--- a/src/raw.rs
+++ b/src/raw.rs
@@ -20,6 +20,16 @@
/// When serializing, a value of this type will retain its original formatting
/// and will not be minified or pretty-printed.
///
+/// # Note
+///
+/// `RawValue` is only available if serde\_json is built with the `"raw_value"`
+/// feature.
+///
+/// ```toml
+/// [dependencies]
+/// serde_json = { version = "1.0", features = ["raw_value"] }
+/// ```
+///
/// # Example
///
/// ```edition2018
@@ -100,16 +110,6 @@
/// raw_value: Box<RawValue>,
/// }
/// ```
-///
-/// # Note
-///
-/// `RawValue` is only available if serde\_json is built with the `"raw_value"`
-/// feature.
-///
-/// ```toml
-/// [dependencies]
-/// serde_json = { version = "1.0", features = ["raw_value"] }
-/// ```
#[repr(C)]
pub struct RawValue {
json: str,
diff --git a/src/ser.rs b/src/ser.rs
index 463c15a..cfae381 100644
--- a/src/ser.rs
+++ b/src/ser.rs
@@ -1711,7 +1711,7 @@
W: io::Write,
{
let mut buffer = ryu::Buffer::new();
- let s = buffer.format(value);
+ let s = buffer.format_finite(value);
writer.write_all(s.as_bytes())
}
@@ -1722,7 +1722,7 @@
W: io::Write,
{
let mut buffer = ryu::Buffer::new();
- let s = buffer.format(value);
+ let s = buffer.format_finite(value);
writer.write_all(s.as_bytes())
}