Bug 1402419 - Revendor deps; r?xidorn
MozReview-Commit-ID: 3Mpt15oWjMO
--- a/third_party/rust/dtoa-short/.cargo-checksum.json
+++ b/third_party/rust/dtoa-short/.cargo-checksum.json
@@ -1,1 +1,1 @@
-{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","Cargo.toml":"90c3a15876071be21dddea79c9f5ce5720a07d81e46200a63ee2618a11291724","src/lib.rs":"7335c26a60f0b58a6849a066e4d8998cd202431f5abf4fc06e4f112249fa6cdb"},"package":"fe6f727b406462fd57c95fed84d1b0dbfb5f0136fcac005adba9ea0367c05cc8"}
\ No newline at end of file
+{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","Cargo.toml":"72a50a7572b499bcb5fe019d7eb60741e7ab5ade14c61bad1a4342a9792720a1","src/lib.rs":"efac1b36819fe8414df20b3fca2ebd1590d320075d0796996c63c8a87cdbee90"},"package":"068d4026697c1a18f0b0bb8cfcad1b0c151b90d8edb9bf4c235ad68128920d1d"}
\ No newline at end of file
--- a/third_party/rust/dtoa-short/Cargo.toml
+++ b/third_party/rust/dtoa-short/Cargo.toml
@@ -7,17 +7,17 @@
#
# If you believe there's an error in this file please file an
# issue against the rust-lang/cargo repository. If you're
# editing this file be aware that the upstream Cargo.toml
# will likely look very different (and much more reasonable)
[package]
name = "dtoa-short"
-version = "0.3.0"
+version = "0.3.1"
authors = ["Xidorn Quan <me@upsuper.org>"]
include = ["src/*.rs", "Cargo.toml"]
description = "Serialize float number and truncate to certain precision"
keywords = ["float"]
categories = ["value-formatting"]
license = "MPL-2.0"
repository = "https://github.com/upsuper/dtoa-short"
[dependencies.dtoa]
--- a/third_party/rust/dtoa-short/src/lib.rs
+++ b/third_party/rust/dtoa-short/src/lib.rs
@@ -63,17 +63,17 @@ fn write_with_prec<W, V>(dest: &mut W, v
let len = dtoa::write(&mut buf[1..], value).map_err(|_| fmt::Error)?;
let (result, notation) = restrict_prec(&mut buf[0..len + 1], prec);
dest.write_str(str::from_utf8(result).unwrap())?;
Ok(notation)
}
fn restrict_prec(buf: &mut [u8], prec: usize) -> (&[u8], Notation) {
let len = buf.len();
- debug_assert!(len <= BUFFER_SIZE, "dtoa may have changed its buffer size");
+ debug_assert!(len <= BUFFER_SIZE + 1, "dtoa may have changed its buffer size");
// Put a leading zero to capture any carry.
debug_assert!(buf[0] == b'\0', "Caller must prepare an empty byte for us");
buf[0] = b'0';
// Remove the sign for now. We will put it back at the end.
let sign = match buf[1] {
s @ b'+' | s @ b'-' => {
buf[1] = b'0';
Some(s)