Commit Graph

92 Commits

Author SHA1 Message Date
David Tolnay ef4faeda61
Release 1.0.5 2022-12-17 11:20:14 -08:00
David Tolnay faae88d4ea
Release 1.0.4 2022-10-06 16:06:04 -07:00
David Tolnay 91ba6e8326
Add no-panic feature to confirm no panicking codepaths 2022-10-06 16:02:42 -07:00
David Tolnay ccd581e524
Release 1.0.3 2022-08-03 06:52:18 -07:00
David Tolnay 366ff427d7
Use upstreamed docs.rs icon in docs.rs badge 2022-06-11 10:17:10 -07:00
David Tolnay f3485c0ef7
Release 1.0.2 2022-05-15 14:09:51 -07:00
David Tolnay ba8dd88380
Release 1.0.1 2021-12-12 12:07:18 -08:00
David Tolnay fcdb43ec93
Remove no longer triggered clippy suppressions 2021-12-12 12:03:59 -08:00
David Tolnay 52466ab21b
Resolve clippy transmute_ptr_to_ptr lint 2021-12-12 12:00:36 -08:00
David Tolnay f7502e28ab
Move buffer cast operation out of macro 2021-12-12 11:59:10 -08:00
David Tolnay e2609a2fb7
Combine IntegerPrivate into Sealed trait 2021-12-12 11:53:52 -08:00
David Tolnay 93b0d619fc
Inline impl_IntegerCommon macro 2021-12-12 11:52:29 -08:00
David Tolnay 260dfafbd9
Move buffer type to associated type of IntegerPrivate 2021-12-12 11:50:52 -08:00
David Tolnay 2d2eac29b4
Begin unifying write_to signature with write 2021-12-12 11:49:40 -08:00
David Tolnay 54b4f3db29
Guarantee that Integer: Copy 2021-12-12 11:46:02 -08:00
David Tolnay 0f27c02804
Move write implementation out to the private trait 2021-12-12 11:44:54 -08:00
David Tolnay e6a8f6f2f1
Release 1.0.0 2021-12-12 10:42:05 -08:00
David Tolnay ef7c22a081
Remove impl Copy on Buffer 2021-12-12 00:31:45 -08:00
David Tolnay 4f958fd42f
Reword Buffer documentation 2021-12-12 00:31:22 -08:00
David Tolnay b85761ea04
Link to ryu as successor to dtoa 2021-12-11 21:19:33 -08:00
David Tolnay b618d972b2
Adjust documentation 2021-12-11 21:18:35 -08:00
David Tolnay 58e20ae3f3
Drop std feature 2021-12-11 21:08:36 -08:00
David Tolnay f90632b9db
Delete io write function 2021-12-11 21:07:41 -08:00
David Tolnay 9cf53f1083
Delete fmt function 2021-12-11 21:07:14 -08:00
David Tolnay 2581c8cee7
Eliminate itoa::write and itoa::fmt from rustdoc 2021-12-11 20:59:11 -08:00
David Tolnay e970e7117f
Enable 128-bit impls unconditionally 2021-12-11 00:54:25 -08:00
David Tolnay 63d5944d90
Suppress remaining clippy lints in udiv128 2021-12-11 00:54:19 -08:00
David Tolnay fb7a827f32
Resolve precedence clippy lint
error: operator precedence can trip the unwary
      --> src/udiv128.rs:15:17
       |
    15 |     let high2 = x_hi as u128 * y_lo as u128 + m_lo as u128 >> 64;
       |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `(x_hi as u128 * y_lo as u128 + m_lo as u128) >> 64`
       |
       = note: `-D clippy::precedence` implied by `-D clippy::all`
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence
2021-12-11 00:54:15 -08:00
David Tolnay 3091ce69da
Evaluate constant u128 factor 2021-12-11 00:54:10 -08:00
David Tolnay 3101467676
Replace deprecated mem::uninitialized with MaybeUninit 2021-12-11 00:31:43 -08:00
David Tolnay 035d16fda5
Resolve redundant_static_lifetimes clippy lint
error: constants have by default a `'static` lifetime
       --> src/lib.rs:161:24
        |
    161 | const DEC_DIGITS_LUT: &'static [u8] = b"\
        |                       -^^^^^^^----- help: consider removing `'static`: `&[u8]`
        |
        = note: `-D clippy::redundant-static-lifetimes` implied by `-D clippy::all`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
2021-12-11 00:22:24 -08:00
David Tolnay 36c5ae17b4
Convert clippy lint level attributes to tool attrs 2021-12-11 00:16:44 -08:00
David Tolnay d1d4554f26
Suppress broken semicolon_if_nothing_returned lint
Gonna assume this is due to https://github.com/rust-lang/rust-clippy/issues/7768.

    error: consider adding a `;` to the last statement for consistent formatting
       --> src/lib.rs:271:1
        |
    271 | / impl_Integer!(
    272 | |     I8_MAX_LEN => i8,
    273 | |     U8_MAX_LEN => u8,
    274 | |     I16_MAX_LEN => i16,
    ...   |
    277 | |     U32_MAX_LEN => u32
    278 | |     as u32);
        | |____________^
        |
        = note: `-D clippy::semicolon-if-nothing-returned` implied by `-D clippy::pedantic`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
    help: add a `;` here
        |
    271 + impl_Integer!(
    272 +     I8_MAX_LEN => i8,
    273 +     U8_MAX_LEN => u8,
    274 +     I16_MAX_LEN => i16,
    275 +     U16_MAX_LEN => u16,
    276 +     I32_MAX_LEN => i32,
      ...

    error: consider adding a `;` to the last statement for consistent formatting
       --> src/lib.rs:280:1
        |
    280 | impl_Integer!(I64_MAX_LEN => i64, U64_MAX_LEN => u64 as u64);
        | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `impl_Integer!(I64_MAX_LEN => i64, U64_MAX_LEN => u64 as u64);;`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned

    error: consider adding a `;` to the last statement for consistent formatting
       --> src/lib.rs:289:1
        |
    289 | impl_Integer!(I64_MAX_LEN => isize, U64_MAX_LEN => usize as u64);
        | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `impl_Integer!(I64_MAX_LEN => isize, U64_MAX_LEN => usize as u64);;`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
2021-10-04 23:50:01 -04:00
David Tolnay dd3f590c41
Format with rustfmt 2021-09-29 2021-09-30 01:28:16 -04:00
David Tolnay de247d6ac2
Release 0.4.8 2021-08-21 22:22:57 -07:00
David Tolnay 2886a30f1c
Merge pull request 27 from Kogia-sima/perf/optimize-udivmod 2021-08-21 22:22:17 -07:00
Kogia-sima 3a4047df0d fix: Fix compilation error on 1.0.0 2021-01-29 00:36:39 +09:00
Kogia-sima 51f3f12113 perf: Optimize udivmod_1e19 function 2021-01-28 23:47:57 +09:00
David Tolnay d00b37103f
Opt in to pedantic clippy lints 2020-12-29 17:10:05 -08:00
David Tolnay cc8ab5800c
Run clippy linter in CI 2020-12-29 17:08:48 -08:00
David Tolnay 08c79b5e23
Release 0.4.7 2020-12-27 12:59:05 -08:00
Samuel Marks 8d64f674a0
[*.rs] rustfmt 2020-06-29 12:00:26 +10:00
David Tolnay 4911818fcf
Release 0.4.6 2020-06-16 11:30:45 -07:00
David Tolnay efc758b646
Add crosslink icons to top of rustdoc 2020-06-13 22:36:24 -07:00
David Tolnay 0ecba421fa
Release 0.4.5 2020-01-24 13:04:40 -08:00
David Tolnay 94c358c535
Eliminate deprecation warnings
Closes #23.
2020-01-24 13:01:04 -08:00
David Tolnay 7ef10b214d
Release 0.4.4 2019-05-01 19:28:28 -07:00
David Tolnay 6bc31f5ec8
Update set of suppressions for clippy 2019-04-30 2019-05-01 19:11:50 -07:00
David Tolnay b2ac3011f7
Elide lifetime that can be inferred 2019-05-01 19:10:39 -07:00
David Tolnay 525e1805f4
Copy part of readme to crate-level doc 2019-05-01 18:26:44 -07:00
David Tolnay 7e81b0290a
Remove unnecessary license header 2019-05-01 18:23:44 -07:00
David Tolnay 17d828c5a6
Clarify udiv128 licensing 2019-05-01 18:23:30 -07:00
David Tolnay 26dcb96645
Remove unneeded ```rust from rustdoc 2019-04-30 01:20:42 -07:00
David Tolnay caec2745c6
Release 0.4.3 2018-09-08 12:12:18 -07:00
David Tolnay 01f062e16c
Format with rustfmt 0.99.4 2018-09-08 12:11:11 -07:00
David Tolnay d4da1d250d
Remove i128 feature gate
These features have been stabilized in Rust 1.26.
2018-09-08 12:09:44 -07:00
David Tolnay 34bea2ee3f
Implement Clone to support old compilers
Arrays above size 32 are not Clone on old compilers.
2018-09-08 12:07:16 -07:00
David Tolnay de113feb96
Add example of using itoa::Buffer 2018-09-08 12:05:53 -07:00
David Tolnay 4b662e7486
Inline the buffer construction functions
Otherwise there ends up being a copy of the 40-byte buffer. Noticeable
improvement on `cargo bench` in the small integer cases compared to
parent commit.
2018-09-08 12:02:44 -07:00
Markus Westerlind 658f09f9c2 feat: Provide a safe API to write integers to a buffer
Closes #19
2018-09-07 21:30:48 +02:00
David Tolnay 878d441e35
Release 0.4.2 2018-07-05 13:40:01 -07:00
David Tolnay 8f91e1ef02
Release 0.4.1 2018-03-22 09:56:28 -07:00
Object905 e6f1c2ee7e use one u64 impl 2018-03-22 13:38:52 +05:00
Object905 d29c6a6718 remove space 2018-03-22 13:18:40 +05:00
Object905 4499b94fcd add #[inline] 2018-03-21 07:48:34 +05:00
Object905 e86a5a54cc use different buffer size for every type 2018-03-21 07:44:57 +05:00
David Tolnay ab5b81e08d
Release 0.4.0 2018-03-18 00:25:42 -07:00
David Tolnay ef180dc6e7
Document sealed trait 2018-03-18 00:22:56 -07:00
David Tolnay f341315473
Remove trait methods from public API 2018-03-18 00:20:35 -07:00
Mike Hommey 70883abe4d Support no_std
Fixes #3.
2018-03-18 15:58:47 +09:00
Mike Hommey 9f3e867f04 Provide itoa::fmt to write to fmt::Write
Fixes #5.
2018-03-18 15:52:58 +09:00
Mike Hommey 39e80cca43 Prevent downstream implementations of the Integer trait 2018-03-18 15:49:59 +09:00
Mike Hommey ccdcae586f Move out impl Integer to a common macro 2018-03-17 10:16:02 +09:00
David Tolnay 13d1f096ea
Release 0.3.4 2017-09-16 14:30:35 -07:00
David Tolnay a3dadb1557
Suppress some clippy lints 2017-09-16 14:22:05 -07:00
David Tolnay 37d2fda49b
Pick up 4-characters-at-a-time fix from libcore
b0e55a83a8
2017-09-16 14:19:21 -07:00
David Tolnay 35106024c6
Indent macro body 2017-09-16 14:12:12 -07:00
David Tolnay 3e47651d90
Write u128 using only two divisions 2017-09-16 13:58:02 -07:00
David Tolnay 23d280dc7a
Simplify udivmodti4 for our special case
This isn't faster, just easier to understand.
2017-09-16 11:49:36 -07:00
Henning Ottesen 1d85a0c5f9 Copy udivmodti4 from compiler-builtins
Division with remainder on u128 is badly optimized by LLVM. Copying it
into our crate allows for inlining and proper optimization.
2017-09-14 23:52:42 +02:00
Henning Ottesen e9069ce1f1 Add support for 128-bit integers 2017-09-13 03:50:47 +02:00
Simon Sapin d954ca8451
Use a byte literal ASCII 0 instead of its decimal value. 2017-08-29 23:46:04 -07:00
David Tolnay b460ecbdc4
Release 0.3.3 2017-08-29 09:53:28 -07:00
Simon Sapin f5d656f81f
Reduce the amount of code generic on W: io::Write 2017-08-29 09:48:00 -07:00
Simon Sapin 220a8680ca
Include the minus sign in the same buffer, to only make a single write_all call. 2017-08-29 09:47:56 -07:00
David Tolnay 678a4b4524
Release 0.3.2 2017-08-22 19:50:39 -07:00
David Tolnay 0ac0d9c4aa
Set html_root_url to docs.rs 2017-08-22 19:50:16 -07:00
Anthony Ramine bd4884d34b Return the number of bytes written from itoa::write (fixes #6) 2017-01-28 22:14:54 +01:00
Anthony Ramine 07bd275999 Make itoa::write take a W instead of a &mut W 2017-01-28 22:12:59 +01:00
David Tolnay 97dad04178
Accept references to trait objects 2017-01-23 16:45:03 -08:00
David Tolnay 4369fc4dc7
Inline itoa::write 2016-06-25 15:09:31 -07:00
David Tolnay 92e5b742e9
itoa::write 2016-06-25 14:32:23 -07:00