Commit Graph

232 Commits

Author SHA1 Message Date
David Tolnay f42787cdc2
Eliminate itoa::write and itoa::fmt from readme 2021-12-11 20:58:56 -08:00
David Tolnay 259ae8a794
Eliminate itoa::write and itoa::fmt from benches 2021-12-11 20:58:55 -08:00
David Tolnay 1898210ac6
Eliminate itoa::write and itoa::fmt from tests 2021-12-11 20:44:52 -08:00
David Tolnay 865a5517ea
Remove 2015-style extern crate from test and benches 2021-12-11 20:41:09 -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 4d0a8c78c2
Raise clippy lints up to 1.31 compatibility 2021-12-11 00:22:02 -08:00
David Tolnay 36c5ae17b4
Convert clippy lint level attributes to tool attrs 2021-12-11 00:16:44 -08:00
David Tolnay 341086a6ff
Update to 2018 edition and rust 1.31+ 2021-12-11 00:14:08 -08:00
David Tolnay 96eef6ef6e
Track raw pointers in miri CI run 2021-12-11 00:04:28 -08:00
David Tolnay f1a3a6faf3
Merge pull request #30 from dtolnay/miri
Add a miri test job in CI
2021-12-10 23:09:08 -08:00
David Tolnay 415ab8cf9a
Add a miri test job in CI 2021-12-10 23:06:40 -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 93e32f72f8
Declare minimum Rust version in Cargo metadata 2021-10-02 01:52:37 -04:00
David Tolnay 64d46a7b1d
Remove no longer triggered string_lit_as_bytes suppression 2021-09-30 01:31:19 -04:00
David Tolnay f12db11b61
Ignore renamed_and_removed_lints clippy warning
We run our test suite as far back as rustc 1.20, which does not support
the modern tool attribute syntax.

    warning: lint name `cast_lossless` is deprecated and may not have an effect in the future.
     --> tests/test.rs:3:11
      |
    3 |     allow(cast_lossless, string_lit_as_bytes, unseparated_literal_suffix)
      |           ^^^^^^^^^^^^^ help: change it to: `clippy::cast_lossless`
      |
      = note: `#[warn(renamed_and_removed_lints)]` on by default

    warning: lint name `string_lit_as_bytes` is deprecated and may not have an effect in the future.
     --> tests/test.rs:3:26
      |
    3 |     allow(cast_lossless, string_lit_as_bytes, unseparated_literal_suffix)
      |                          ^^^^^^^^^^^^^^^^^^^ help: change it to: `clippy::string_lit_as_bytes`

    warning: lint name `unseparated_literal_suffix` is deprecated and may not have an effect in the future.
     --> tests/test.rs:3:47
      |
    3 |     allow(cast_lossless, string_lit_as_bytes, unseparated_literal_suffix)
      |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change it to: `clippy::unseparated_literal_suffix`
2021-09-30 01:29:45 -04:00
David Tolnay dd3f590c41
Format with rustfmt 2021-09-29 2021-09-30 01:28:16 -04:00
David Tolnay 8f58e3f645
Run clippy on test suite too 2021-09-30 01:28:03 -04:00
David Tolnay 462ada420f
Skip clippy job on pull requests 2021-09-18 16:40:22 -07: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 ac8183cdaf
Fix catching clippy warnings as CI failures 2021-01-04 23:47:11 -08:00
David Tolnay d00b37103f
Opt in to pedantic clippy lints 2020-12-29 17:10:05 -08:00
David Tolnay 4235341107
Inform clippy of supported compiler version in clippy.toml 2020-12-29 17:08:48 -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
David Tolnay 65c797190c
Point Cargo.toml metadata documentation link to docs.rs 2020-12-07 19:34:16 -08:00
David Tolnay cdcf6374b6
Merge pull request #25 from SamuelMarks/rustfmt
[*.rs] rustfmt
2020-06-28 19:09:13 -07: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 63abae9b82
Add a sponsors link 2020-06-14 13:20:05 -07:00
David Tolnay efc758b646
Add crosslink icons to top of rustdoc 2020-06-13 22:36:24 -07:00
David Tolnay f075e1bf71
New style of readme badges 2020-06-13 22:36:21 -07:00
David Tolnay 5618b9dc41
Update build status badge to GitHub Actions 2020-05-05 23:58:28 -07:00
David Tolnay a2c6d4bab3
Remove Travis configuration 2020-05-05 11:29:48 -07:00
David Tolnay c899fd6d1d
Merge pull request #24 from dtolnay/actions
Enable GitHub Actions
2020-05-02 23:43:21 -07:00
David Tolnay 9a46d47e2e
Enable GitHub Actions 2020-05-02 23:39:08 -07:00
David Tolnay 641889d2ba
Remove CI badge from Cargo.toml
Support for badges has been deprecated by crates.io.
2020-05-01 21:02:30 -07:00
David Tolnay d3bd82265d
Select a single docs.rs build target 2020-03-17 13:23:09 -07:00
David Tolnay 0ecba421fa
Release 0.4.5 2020-01-24 13:04:40 -08:00
David Tolnay 40020b76c1
Add release-mode tests 2020-01-24 13:02:35 -08:00
David Tolnay 94c358c535
Eliminate deprecation warnings
Closes #23.
2020-01-24 13:01:04 -08:00
David Tolnay 80c60941d6
Switch to SPDX 2.1 license expression 2019-05-09 15:30:19 -07:00
David Tolnay 7ef10b214d
Release 0.4.4 2019-05-01 19:28:28 -07:00
David Tolnay b503c823e5
Skip doc tests when testing without std 2019-05-01 19:20:15 -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 6b8a090932
Remove nightly flags from benchmark 2019-05-01 19:07:08 -07:00
David Tolnay 17bbd67b77
Support for i128 no longer requires nightly 2019-05-01 19:06:54 -07:00
David Tolnay c76fae7f12
Space apart the readme sections 2019-05-01 19:04:53 -07:00
David Tolnay c51cdbfd80
Document rustc version requirement 2019-05-01 19:04:31 -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 35ea54ed6b
Revamp readme 2019-05-01 18:09:29 -07:00
David Tolnay 26dcb96645
Remove unneeded ```rust from rustdoc 2019-04-30 01:20:42 -07:00
David Tolnay 26e8defc8d
Verbose build output is not valuable 2018-10-28 00:06:41 -07:00
David Tolnay 03846c8925
No longer need i128 feature gate which has been stabilized 2018-10-13 20:10:31 -07:00
David Tolnay 0e4d65d9eb
Fix .travis.yml that was failing to parse 2018-10-13 19:59:41 -07:00
David Tolnay caec2745c6
Release 0.4.3 2018-09-08 12:12:18 -07:00
David Tolnay e35aacd5cb
Test i128 feature on stable and beta as well 2018-09-08 12:11:55 -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
David Tolnay 762dedb54c
Merge pull request #20 from Marwes/buffer
feat: Provide a safe API to write integers to a buffer
2018-09-08 12:00:25 -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 058439f12f
Display a Travis badge on crates.io 2018-08-07 00:19:40 -07:00
David Tolnay 878d441e35
Release 0.4.2 2018-07-05 13:40:01 -07:00
David Tolnay a6c698fcda
Remove unnecessary copyright notice in MIT license 2018-07-05 13:39:29 -07:00
David Tolnay 2a7134627d
Test a minimum supported version 2018-06-07 22:48:06 -07:00
David Tolnay 8f91e1ef02
Release 0.4.1 2018-03-22 09:56:28 -07:00
David Tolnay ce0dc0452d
Merge pull request #16 from Object905/master
Use different buffer size for every integer type
2018-03-22 09:55:57 -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 c7c3caf3b9
Benchmark for itoa::fmt 2018-03-18 00:25:02 -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
David Tolnay e3af30b7c4
Punctuation to appease syntax highlighter 2018-03-18 00:18:12 -07:00
David Tolnay c1c4f7320e
Merge pull request #14 from glandium/master
Support no_std
2018-03-18 00:14:19 -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 34bffe2943 Merge pull request #12 from dtolnay/fast
Write u128 using only two divisions
2017-09-16 14:08:56 -07:00
David Tolnay 3e47651d90
Write u128 using only two divisions 2017-09-16 13:58:02 -07:00