From 01f062e16c6b6fc2e113985ea7c74bb52c2ad87c Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 8 Sep 2018 12:11:06 -0700 Subject: [PATCH] Format with rustfmt 0.99.4 --- benches/bench.rs | 2 -- src/lib.rs | 19 +++++++++++-------- tests/test.rs | 7 ++++--- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/benches/bench.rs b/benches/bench.rs index 7e6ca82..8f5f25d 100644 --- a/benches/bench.rs +++ b/benches/bench.rs @@ -1,7 +1,5 @@ #![cfg_attr(feature = "i128", feature(i128_type, i128))] - #![cfg_attr(feature = "cargo-clippy", allow(cast_lossless))] - #![feature(test)] #![allow(non_snake_case)] diff --git a/src/lib.rs b/src/lib.rs index 0de3a53..30299b4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,10 +7,11 @@ // except according to those terms. #![doc(html_root_url = "https://docs.rs/itoa/0.4.2")] - #![cfg_attr(not(feature = "std"), no_std)] - -#![cfg_attr(feature = "cargo-clippy", allow(cast_lossless, unreadable_literal))] +#![cfg_attr( + feature = "cargo-clippy", + allow(cast_lossless, unreadable_literal) +)] #[cfg(feature = "i128")] mod udiv128; @@ -71,7 +72,9 @@ impl Buffer { /// for efficiency. #[inline] 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 @@ -99,8 +102,8 @@ trait IntegerPrivate { fn write_to(self, buf: &mut B) -> &[u8]; } -const DEC_DIGITS_LUT: &'static[u8] = - b"0001020304050607080910111213141516171819\ +const DEC_DIGITS_LUT: &'static [u8] = b"\ + 0001020304050607080910111213141516171819\ 2021222324252627282930313233343536373839\ 4041424344454647484950515253545556575859\ 6061626364656667686970717273747576777879\ @@ -116,7 +119,7 @@ macro_rules! impl_IntegerCommon { unsafe { debug_assert!($max_len <= I128_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); str::from_utf8_unchecked(bytes) @@ -212,7 +215,7 @@ impl_Integer!( I16_MAX_LEN => i16, U16_MAX_LEN => u16, I32_MAX_LEN => i32, - U32_MAX_LEN => u32 + U32_MAX_LEN => u32 as u32); impl_Integer!(I64_MAX_LEN => i64, U64_MAX_LEN => u64 as u64); diff --git a/tests/test.rs b/tests/test.rs index ad7c3d7..8047f33 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -1,7 +1,8 @@ #![cfg_attr(feature = "i128", feature(i128_type, i128))] - -#![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;