Format with rustfmt 0.99.4
This commit is contained in:
parent
d4da1d250d
commit
01f062e16c
|
@ -1,7 +1,5 @@
|
||||||
#![cfg_attr(feature = "i128", feature(i128_type, i128))]
|
#![cfg_attr(feature = "i128", feature(i128_type, i128))]
|
||||||
|
|
||||||
#![cfg_attr(feature = "cargo-clippy", allow(cast_lossless))]
|
#![cfg_attr(feature = "cargo-clippy", allow(cast_lossless))]
|
||||||
|
|
||||||
#![feature(test)]
|
#![feature(test)]
|
||||||
#![allow(non_snake_case)]
|
#![allow(non_snake_case)]
|
||||||
|
|
||||||
|
|
17
src/lib.rs
17
src/lib.rs
|
@ -7,10 +7,11 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![doc(html_root_url = "https://docs.rs/itoa/0.4.2")]
|
#![doc(html_root_url = "https://docs.rs/itoa/0.4.2")]
|
||||||
|
|
||||||
#![cfg_attr(not(feature = "std"), no_std)]
|
#![cfg_attr(not(feature = "std"), no_std)]
|
||||||
|
#![cfg_attr(
|
||||||
#![cfg_attr(feature = "cargo-clippy", allow(cast_lossless, unreadable_literal))]
|
feature = "cargo-clippy",
|
||||||
|
allow(cast_lossless, unreadable_literal)
|
||||||
|
)]
|
||||||
|
|
||||||
#[cfg(feature = "i128")]
|
#[cfg(feature = "i128")]
|
||||||
mod udiv128;
|
mod udiv128;
|
||||||
|
@ -71,7 +72,9 @@ impl Buffer {
|
||||||
/// for efficiency.
|
/// for efficiency.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn new() -> Buffer {
|
pub fn new() -> Buffer {
|
||||||
Buffer { bytes: unsafe { mem::uninitialized() } }
|
Buffer {
|
||||||
|
bytes: unsafe { mem::uninitialized() },
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Print an integer into this buffer and return a reference to its string representation
|
/// Print an integer into this buffer and return a reference to its string representation
|
||||||
|
@ -99,8 +102,8 @@ trait IntegerPrivate<B> {
|
||||||
fn write_to(self, buf: &mut B) -> &[u8];
|
fn write_to(self, buf: &mut B) -> &[u8];
|
||||||
}
|
}
|
||||||
|
|
||||||
const DEC_DIGITS_LUT: &'static[u8] =
|
const DEC_DIGITS_LUT: &'static [u8] = b"\
|
||||||
b"0001020304050607080910111213141516171819\
|
0001020304050607080910111213141516171819\
|
||||||
2021222324252627282930313233343536373839\
|
2021222324252627282930313233343536373839\
|
||||||
4041424344454647484950515253545556575859\
|
4041424344454647484950515253545556575859\
|
||||||
6061626364656667686970717273747576777879\
|
6061626364656667686970717273747576777879\
|
||||||
|
@ -116,7 +119,7 @@ macro_rules! impl_IntegerCommon {
|
||||||
unsafe {
|
unsafe {
|
||||||
debug_assert!($max_len <= I128_MAX_LEN);
|
debug_assert!($max_len <= I128_MAX_LEN);
|
||||||
let buf = mem::transmute::<&mut [u8; I128_MAX_LEN], &mut [u8; $max_len]>(
|
let buf = mem::transmute::<&mut [u8; I128_MAX_LEN], &mut [u8; $max_len]>(
|
||||||
&mut buf.bytes
|
&mut buf.bytes,
|
||||||
);
|
);
|
||||||
let bytes = self.write_to(buf);
|
let bytes = self.write_to(buf);
|
||||||
str::from_utf8_unchecked(bytes)
|
str::from_utf8_unchecked(bytes)
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
#![cfg_attr(feature = "i128", feature(i128_type, i128))]
|
#![cfg_attr(feature = "i128", feature(i128_type, i128))]
|
||||||
|
#![cfg_attr(
|
||||||
#![cfg_attr(feature = "cargo-clippy", allow(cast_lossless, string_lit_as_bytes))]
|
feature = "cargo-clippy",
|
||||||
|
allow(cast_lossless, string_lit_as_bytes)
|
||||||
|
)]
|
||||||
#![allow(non_snake_case)]
|
#![allow(non_snake_case)]
|
||||||
|
|
||||||
extern crate itoa;
|
extern crate itoa;
|
||||||
|
|
Loading…
Reference in New Issue