Bug 1716518 - Upgrade itoa to v0.4.7. r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D117806
This commit is contained in:
Mike Hommey 2021-06-15 22:04:47 +00:00
parent 04dd2f4733
commit df7e670107
7 changed files with 30 additions and 21 deletions

4
Cargo.lock generated
View File

@ -2523,9 +2523,9 @@ dependencies = [
[[package]]
name = "itoa"
version = "0.4.4"
version = "0.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f"
checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736"
[[package]]
name = "jobserver"

View File

@ -1 +1 @@
{"files":{"Cargo.toml":"f744809613f4bebac2bce3256ffde0044d9f0cda6adcb2fd0cc462d2afb8ad98","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"398a1f9022fdf54c13326688a2ba060dfb4b247b45cfc731aad00eba39442f2d","benches/bench.rs":"65020d3ef575c4f9aa9f09ab28dc4164d98207515301d7d16b57c3e48d84049d","src/lib.rs":"c818bec8a1e3522f2b34dd7f8c8f36ca26a368e028c96e3c5771cf57a18158fc","src/udiv128.rs":"16c27cc61f69ca79eca3ac624d6baceaccdbf27cfa43c85c7e065c1ff1481748","tests/test.rs":"428d30ab57b412211a6a0faa7ac36b359e37572b259cd05ac56f4dff6078e896"},"package":"501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f"}
{"files":{"Cargo.toml":"2bcb3ad6b578e6c8ca6fb8d702c860204628a03b7d5d007f3389bdf61062ad8d","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"5eac563c0123003363f4706f36927cf4d3b118965e35b51bc515343ce6a711ae","benches/bench.rs":"fc009678431563bfb1b51698fb5b83f5309a3cdab90dc7365800f4e32bc287be","src/lib.rs":"e393804c91616ffaac8ec3ace0711a34beaf303f6fe28fcb3f0cbb65641ff34e","src/udiv128.rs":"16c27cc61f69ca79eca3ac624d6baceaccdbf27cfa43c85c7e065c1ff1481748","tests/test.rs":"c9b124462b75078e2407e0239222edd7859c3112d65a114742dbb8c47dafc07c"},"package":"dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736"}

View File

@ -12,19 +12,19 @@
[package]
name = "itoa"
version = "0.4.4"
version = "0.4.7"
authors = ["David Tolnay <dtolnay@gmail.com>"]
exclude = ["performance.png"]
description = "Fast functions for printing integer primitives to an io::Write"
documentation = "https://github.com/dtolnay/itoa"
documentation = "https://docs.rs/itoa"
readme = "README.md"
categories = ["value-formatting"]
license = "MIT/Apache-2.0"
license = "MIT OR Apache-2.0"
repository = "https://github.com/dtolnay/itoa"
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
[features]
default = ["std"]
i128 = []
std = []
[badges.travis-ci]
repository = "dtolnay/itoa"

View File

@ -1,9 +1,10 @@
itoa
====
[![Build Status](https://api.travis-ci.org/dtolnay/itoa.svg?branch=master)](https://travis-ci.org/dtolnay/itoa)
[![Latest Version](https://img.shields.io/crates/v/itoa.svg)](https://crates.io/crates/itoa)
[![Rust Documentation](https://img.shields.io/badge/api-rustdoc-blue.svg)](https://docs.rs/itoa)
[<img alt="github" src="https://img.shields.io/badge/github-dtolnay/itoa-8da0cb?style=for-the-badge&labelColor=555555&logo=github" height="20">](https://github.com/dtolnay/itoa)
[<img alt="crates.io" src="https://img.shields.io/crates/v/itoa.svg?style=for-the-badge&color=fc8d62&logo=rust" height="20">](https://crates.io/crates/itoa)
[<img alt="docs.rs" src="https://img.shields.io/badge/docs.rs-itoa-66c2a5?style=for-the-badge&labelColor=555555&logoColor=white&logo=data:image/svg+xml;base64,PHN2ZyByb2xlPSJpbWciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDUxMiA1MTIiPjxwYXRoIGZpbGw9IiNmNWY1ZjUiIGQ9Ik00ODguNiAyNTAuMkwzOTIgMjE0VjEwNS41YzAtMTUtOS4zLTI4LjQtMjMuNC0zMy43bC0xMDAtMzcuNWMtOC4xLTMuMS0xNy4xLTMuMS0yNS4zIDBsLTEwMCAzNy41Yy0xNC4xIDUuMy0yMy40IDE4LjctMjMuNCAzMy43VjIxNGwtOTYuNiAzNi4yQzkuMyAyNTUuNSAwIDI2OC45IDAgMjgzLjlWMzk0YzAgMTMuNiA3LjcgMjYuMSAxOS45IDMyLjJsMTAwIDUwYzEwLjEgNS4xIDIyLjEgNS4xIDMyLjIgMGwxMDMuOS01MiAxMDMuOSA1MmMxMC4xIDUuMSAyMi4xIDUuMSAzMi4yIDBsMTAwLTUwYzEyLjItNi4xIDE5LjktMTguNiAxOS45LTMyLjJWMjgzLjljMC0xNS05LjMtMjguNC0yMy40LTMzLjd6TTM1OCAyMTQuOGwtODUgMzEuOXYtNjguMmw4NS0zN3Y3My4zek0xNTQgMTA0LjFsMTAyLTM4LjIgMTAyIDM4LjJ2LjZsLTEwMiA0MS40LTEwMi00MS40di0uNnptODQgMjkxLjFsLTg1IDQyLjV2LTc5LjFsODUtMzguOHY3NS40em0wLTExMmwtMTAyIDQxLjQtMTAyLTQxLjR2LS42bDEwMi0zOC4yIDEwMiAzOC4ydi42em0yNDAgMTEybC04NSA0Mi41di03OS4xbDg1LTM4Ljh2NzUuNHptMC0xMTJsLTEwMiA0MS40LTEwMi00MS40di0uNmwxMDItMzguMiAxMDIgMzguMnYuNnoiPjwvcGF0aD48L3N2Zz4K" height="20">](https://docs.rs/itoa)
[<img alt="build status" src="https://img.shields.io/github/workflow/status/dtolnay/itoa/CI/master?style=for-the-badge" height="20">](https://github.com/dtolnay/itoa/actions?query=branch%3Amaster)
This crate provides fast functions for printing integer primitives to an
[`io::Write`] or a [`fmt::Write`]. The implementation comes straight from

View File

@ -68,7 +68,7 @@ macro_rules! benches {
}
}
benches!{
benches! {
bench_u64_0(0u64),
bench_u64_half(<u32>::max_value() as u64),
bench_u64_max(<u64>::max_value()),

View File

@ -1,3 +1,11 @@
//! [![github]](https://github.com/dtolnay/itoa)&ensp;[![crates-io]](https://crates.io/crates/itoa)&ensp;[![docs-rs]](https://docs.rs/itoa)
//!
//! [github]: https://img.shields.io/badge/github-8da0cb?style=for-the-badge&labelColor=555555&logo=github
//! [crates-io]: https://img.shields.io/badge/crates.io-fc8d62?style=for-the-badge&labelColor=555555&logo=rust
//! [docs-rs]: https://img.shields.io/badge/docs.rs-66c2a5?style=for-the-badge&labelColor=555555&logoColor=white&logo=data:image/svg+xml;base64,PHN2ZyByb2xlPSJpbWciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDUxMiA1MTIiPjxwYXRoIGZpbGw9IiNmNWY1ZjUiIGQ9Ik00ODguNiAyNTAuMkwzOTIgMjE0VjEwNS41YzAtMTUtOS4zLTI4LjQtMjMuNC0zMy43bC0xMDAtMzcuNWMtOC4xLTMuMS0xNy4xLTMuMS0yNS4zIDBsLTEwMCAzNy41Yy0xNC4xIDUuMy0yMy40IDE4LjctMjMuNCAzMy43VjIxNGwtOTYuNiAzNi4yQzkuMyAyNTUuNSAwIDI2OC45IDAgMjgzLjlWMzk0YzAgMTMuNiA3LjcgMjYuMSAxOS45IDMyLjJsMTAwIDUwYzEwLjEgNS4xIDIyLjEgNS4xIDMyLjIgMGwxMDMuOS01MiAxMDMuOSA1MmMxMC4xIDUuMSAyMi4xIDUuMSAzMi4yIDBsMTAwLTUwYzEyLjItNi4xIDE5LjktMTguNiAxOS45LTMyLjJWMjgzLjljMC0xNS05LjMtMjguNC0yMy40LTMzLjd6TTM1OCAyMTQuOGwtODUgMzEuOXYtNjguMmw4NS0zN3Y3My4zek0xNTQgMTA0LjFsMTAyLTM4LjIgMTAyIDM4LjJ2LjZsLTEwMiA0MS40LTEwMi00MS40di0uNnptODQgMjkxLjFsLTg1IDQyLjV2LTc5LjFsODUtMzguOHY3NS40em0wLTExMmwtMTAyIDQxLjQtMTAyLTQxLjR2LS42bDEwMi0zOC4yIDEwMiAzOC4ydi42em0yNDAgMTEybC04NSA0Mi41di03OS4xbDg1LTM4Ljh2NzUuNHptMC0xMTJsLTEwMiA0MS40LTEwMi00MS40di0uNmwxMDItMzguMiAxMDIgMzguMnYuNnoiPjwvcGF0aD48L3N2Zz4K
//!
//! <br>
//!
//! This crate provides fast functions for printing integer primitives to an
//! [`io::Write`] or a [`fmt::Write`]. The implementation comes straight from
//! [libcore] but avoids the performance penalty of going through
@ -48,12 +56,12 @@
//! }
//! ```
#![doc(html_root_url = "https://docs.rs/itoa/0.4.4")]
#![doc(html_root_url = "https://docs.rs/itoa/0.4.7")]
#![cfg_attr(not(feature = "std"), no_std)]
#![cfg_attr(feature = "cargo-clippy", allow(renamed_and_removed_lints))]
#![cfg_attr(
feature = "cargo-clippy",
allow(const_static_lifetime, transmute_ptr_to_ptr),
allow(const_static_lifetime, transmute_ptr_to_ptr)
)]
#[cfg(feature = "i128")]
@ -71,8 +79,10 @@ use core::{fmt, mem, ptr, slice, str};
pub fn write<W: io::Write, V: Integer>(mut wr: W, value: V) -> io::Result<usize> {
let mut buf = Buffer::new();
let s = buf.format(value);
try!(wr.write_all(s.as_bytes()));
Ok(s.len())
match wr.write_all(s.as_bytes()) {
Ok(()) => Ok(s.len()),
Err(e) => Err(e),
}
}
/// Write integer to an `fmt::Write`.
@ -114,6 +124,7 @@ impl Buffer {
/// This is a cheap operation; you don't need to worry about reusing buffers
/// for efficiency.
#[inline]
#[allow(deprecated)]
pub fn new() -> Buffer {
Buffer {
bytes: unsafe { mem::uninitialized() },

View File

@ -1,7 +1,4 @@
#![cfg_attr(
feature = "cargo-clippy",
allow(cast_lossless, string_lit_as_bytes)
)]
#![cfg_attr(feature = "cargo-clippy", allow(cast_lossless, string_lit_as_bytes))]
#![allow(non_snake_case)]
extern crate itoa;
@ -32,7 +29,7 @@ macro_rules! test {
}
}
test!{
test! {
test_u64_0(0u64, "0"),
test_u64_half(<u32>::max_value() as u64, "4294967295"),
test_u64_max(<u64>::max_value(), "18446744073709551615"),