Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
240 commits
Select commit Hold shift + click to select a range
d3bd822
Select a single docs.rs build target
dtolnay Mar 17, 2020
641889d
Remove CI badge from Cargo.toml
dtolnay May 2, 2020
9a46d47
Enable GitHub Actions
dtolnay May 3, 2020
c899fd6
Merge pull request #24 from dtolnay/actions
dtolnay May 3, 2020
a2c6d4b
Remove Travis configuration
dtolnay May 5, 2020
5618b9d
Update build status badge to GitHub Actions
dtolnay May 6, 2020
f075e1b
New style of readme badges
dtolnay Jun 14, 2020
efc758b
Add crosslink icons to top of rustdoc
dtolnay Jun 14, 2020
63abae9
Add a sponsors link
dtolnay Jun 14, 2020
4911818
Release 0.4.6
dtolnay Jun 16, 2020
8d64f67
[*.rs] rustfmt
SamuelMarks Jun 29, 2020
cdcf637
Merge pull request #25 from SamuelMarks/rustfmt
dtolnay Jun 29, 2020
65c7971
Point Cargo.toml metadata documentation link to docs.rs
dtolnay Dec 8, 2020
08c79b5
Release 0.4.7
dtolnay Dec 27, 2020
cc8ab58
Run clippy linter in CI
dtolnay Dec 30, 2020
4235341
Inform clippy of supported compiler version in clippy.toml
dtolnay Dec 30, 2020
d00b371
Opt in to pedantic clippy lints
dtolnay Dec 30, 2020
ac8183c
Fix catching clippy warnings as CI failures
dtolnay Jan 5, 2021
51f3f12
perf: Optimize udivmod_1e19 function
Kogia-sima Jan 28, 2021
3a4047d
fix: Fix compilation error on 1.0.0
Kogia-sima Jan 28, 2021
2886a30
Merge pull request 27 from Kogia-sima/perf/optimize-udivmod
dtolnay Aug 22, 2021
de247d6
Release 0.4.8
dtolnay Aug 22, 2021
462ada4
Skip clippy job on pull requests
dtolnay Sep 18, 2021
8f58e3f
Run clippy on test suite too
dtolnay Sep 30, 2021
dd3f590
Format with rustfmt 2021-09-29
dtolnay Sep 30, 2021
f12db11
Ignore renamed_and_removed_lints clippy warning
dtolnay Sep 30, 2021
64d46a7
Remove no longer triggered string_lit_as_bytes suppression
dtolnay Sep 30, 2021
93e32f7
Declare minimum Rust version in Cargo metadata
dtolnay Oct 2, 2021
d1d4554
Suppress broken semicolon_if_nothing_returned lint
dtolnay Oct 5, 2021
415ab8c
Add a miri test job in CI
dtolnay Dec 11, 2021
f1a3a6f
Merge pull request #30 from dtolnay/miri
dtolnay Dec 11, 2021
96eef6e
Track raw pointers in miri CI run
dtolnay Dec 11, 2021
341086a
Update to 2018 edition and rust 1.31+
dtolnay Dec 11, 2021
36c5ae1
Convert clippy lint level attributes to tool attrs
dtolnay Dec 11, 2021
4d0a8c7
Raise clippy lints up to 1.31 compatibility
dtolnay Dec 11, 2021
035d16f
Resolve redundant_static_lifetimes clippy lint
dtolnay Dec 11, 2021
3101467
Replace deprecated mem::uninitialized with MaybeUninit
dtolnay Dec 11, 2021
3091ce6
Evaluate constant u128 factor
dtolnay Dec 11, 2021
fb7a827
Resolve precedence clippy lint
dtolnay Dec 11, 2021
63d5944
Suppress remaining clippy lints in udiv128
dtolnay Dec 11, 2021
e970e71
Enable 128-bit impls unconditionally
dtolnay Dec 11, 2021
865a551
Remove 2015-style extern crate from test and benches
dtolnay Dec 12, 2021
1898210
Eliminate itoa::write and itoa::fmt from tests
dtolnay Dec 12, 2021
259ae8a
Eliminate itoa::write and itoa::fmt from benches
dtolnay Dec 12, 2021
f42787c
Eliminate itoa::write and itoa::fmt from readme
dtolnay Dec 12, 2021
2581c8c
Eliminate itoa::write and itoa::fmt from rustdoc
dtolnay Dec 12, 2021
6b06fb0
Remove attr matcher from test and bench macro
dtolnay Dec 12, 2021
42cb96a
Clean up test and bench macro syntax
dtolnay Dec 12, 2021
9cf53f1
Delete fmt function
dtolnay Dec 12, 2021
f90632b
Delete io write function
dtolnay Dec 12, 2021
58e20ae
Drop std feature
dtolnay Dec 12, 2021
1d447bd
Delete outdated documentation
dtolnay Dec 12, 2021
b618d97
Adjust documentation
dtolnay Dec 12, 2021
b85761e
Link to ryu as successor to dtoa
dtolnay Dec 12, 2021
8c3a8a4
Add latex code for performance chart
dtolnay Dec 12, 2021
0788e27
Merge pull request #31 from dtolnay/chart
dtolnay Dec 12, 2021
bfd3ee6
Adjust chart margins and background for dark themes
dtolnay Dec 12, 2021
4f958fd
Reword Buffer documentation
dtolnay Dec 12, 2021
ef7c22a
Remove impl Copy on Buffer
dtolnay Dec 12, 2021
e6a8f6f
Release 1.0.0
dtolnay Dec 12, 2021
0f27c02
Move write implementation out to the private trait
dtolnay Dec 12, 2021
54b4f3d
Guarantee that Integer: Copy
dtolnay Dec 12, 2021
2d2eac2
Begin unifying write_to signature with write
dtolnay Dec 12, 2021
260dfaf
Move buffer type to associated type of IntegerPrivate
dtolnay Dec 12, 2021
93b0d61
Inline impl_IntegerCommon macro
dtolnay Dec 12, 2021
e2609a2
Combine IntegerPrivate into Sealed trait
dtolnay Dec 12, 2021
f7502e2
Move buffer cast operation out of macro
dtolnay Dec 12, 2021
52466ab
Resolve clippy transmute_ptr_to_ptr lint
dtolnay Dec 12, 2021
fcdb43e
Remove no longer triggered clippy suppressions
dtolnay Dec 12, 2021
5d3b787
Run clippy on benches as well
dtolnay Dec 12, 2021
ba8dd88
Release 1.0.1
dtolnay Dec 12, 2021
e2364ef
Detect warnings in CI
dtolnay Jan 1, 2022
5f0c1d0
Add a fuzzer.
adetaylor Mar 4, 2022
8f756bf
Pull miri from miri branch of dtolnay/rust-toolchain
dtolnay Apr 24, 2022
71926ea
Update workflows to actions/checkout@v3
dtolnay Apr 25, 2022
079962b
Drop unneeded quoting from env variable in workflows yaml
dtolnay Apr 29, 2022
5f720ce
Run miri in stricter miri-strict-provenance mode
dtolnay May 6, 2022
0d042ac
Merge pull request #32 from adetaylor/fuzz
dtolnay May 15, 2022
8d798ed
Touch up PR 32 manifest
dtolnay May 15, 2022
5340118
Copy cargo-fuzz generated gitignore
dtolnay May 15, 2022
6ba4e7c
Depend on arbitrary crate directly
dtolnay May 15, 2022
5638af5
Remove unneeded Clone impls from fuzz target
dtolnay May 15, 2022
6f99ca5
Format a single integer per fuzz call
dtolnay May 15, 2022
ff6798f
Move ptr sized integer variant last
dtolnay May 15, 2022
951c29d
Rename ptr sized integer variants
dtolnay May 15, 2022
4f1481a
Assert size of string in fuzz target
dtolnay May 15, 2022
9825ed8
Assert formatted integer parses back to the same value
dtolnay May 15, 2022
e2a55ce
Add CI job to compile fuzz target
dtolnay May 15, 2022
f3485c0
Release 1.0.2
dtolnay May 15, 2022
8e8a845
Add actions job to notice outdated dependencies
dtolnay Jun 7, 2022
366ff42
Use upstreamed docs.rs icon in docs.rs badge
dtolnay Jun 11, 2022
44ed979
Sort package entries in Cargo.toml
dtolnay Aug 1, 2022
f0139eb
Add authors to Cargo.toml
dtolnay Aug 1, 2022
c46afd3
Add no-std category to crates.io metadata
dtolnay Aug 1, 2022
c9010e1
Update keywords in crates.io metadata
dtolnay Aug 2, 2022
ccd581e
Release 1.0.3
dtolnay Aug 3, 2022
8c4881a
GitHub Workflows security hardening
dtolnay Sep 2, 2022
228add3
Remove default package.readme metadata from Cargo.toml
dtolnay Sep 14, 2022
91ba6e8
Add no-panic feature to confirm no panicking codepaths
dtolnay Oct 6, 2022
29aa8d7
Merge pull request #38 from dtolnay/nopanic
dtolnay Oct 6, 2022
faae88d
Release 1.0.4
dtolnay Oct 6, 2022
e035699
Time out workflows after 45 minutes
dtolnay Nov 26, 2022
b74302f
Update build status badge
dtolnay Dec 16, 2022
ef4faed
Release 1.0.5
dtolnay Dec 17, 2022
a77f3c9
Sync license text with rust-lang repos
dtolnay Dec 30, 2022
5bd582c
Opt out -Zrustdoc-scrape-examples on docs.rs
dtolnay Jan 3, 2023
d79365b
Speed up cargo fuzz CI job
dtolnay Jan 20, 2023
40db9e7
Prevent actions duplication on noop merge commits
dtolnay Feb 2, 2023
320250e
Support a manual trigger on CI workflow
dtolnay Feb 19, 2023
e9573cd
Enable type layout randomization in CI on nightly
dtolnay Feb 19, 2023
3cab737
Release 1.0.6
dtolnay Mar 3, 2023
57fa3a3
Update fuzz crate gitignore to ignore coverage dir
dtolnay Mar 26, 2023
97a5102
Show error details during miri setup in CI
dtolnay May 23, 2023
f2d5e27
Remove .clippy.toml in favor of respecting rust-version from Cargo.toml
dtolnay Jun 16, 2023
9c8ced9
impl Copy for Buffer
dtolnay Jul 3, 2023
0dccfa4
Ignore expl_impl_clone_on_copy pedantic clippy lint
dtolnay Jul 3, 2023
21ee1ba
Suppress incorrect_clone_impl_on_copy_type clippy false positive
dtolnay Jul 3, 2023
26259a9
Release 1.0.7
dtolnay Jul 3, 2023
f834fdb
Add no-std::no-alloc category
dtolnay Jul 3, 2023
a6af90f
Release 1.0.8
dtolnay Jul 3, 2023
e3dcf52
Opt in to generate-link-to-definition when building on docs.rs
dtolnay Jul 15, 2023
81c115b
Release 1.0.9
dtolnay Jul 15, 2023
5a2a69e
Temporarily disable -Zrandomize-layout due to rustc ICE
dtolnay Jul 22, 2023
359df33
Revert "Temporarily disable -Zrandomize-layout due to rustc ICE"
dtolnay Jul 23, 2023
03549a2
Update actions/checkout@v3 -> v4
dtolnay Sep 5, 2023
633b6ae
Ignore needless_doctest_main clippy lint
dtolnay Sep 13, 2023
e999a5a
Update name of clippy clone impl lint
dtolnay Sep 14, 2023
2763105
Test docs.rs documentation build in CI
dtolnay Sep 24, 2023
0d040f4
Remove 'remember to update' reminder from Cargo.toml
dtolnay Oct 18, 2023
cefacdb
add missing unit test for i128
JustForMaven Dec 9, 2023
84bffa9
fix CI error
JustForMaven Dec 9, 2023
adecb79
Merge pull request #41 from CXWorks/master
dtolnay Dec 9, 2023
ba20a60
Touch up PR 41
dtolnay Dec 9, 2023
547c143
Release 1.0.10
dtolnay Dec 9, 2023
d5e45f2
Temporarily disable miri on doctests
dtolnay Mar 25, 2024
fde7fa5
More granular `unsafe` blocks.
anforowicz Mar 6, 2024
526d4e4
Explicitly install a Rust toolchain for cargo-outdated job
dtolnay Mar 26, 2024
ea29bbd
Merge pull request #42 from anforowicz/more-granular-unsafe-blocks
dtolnay Mar 26, 2024
eeca57d
Touch up comments
dtolnay Mar 26, 2024
8f39203
Release 1.0.11
dtolnay Mar 26, 2024
0ce0ec2
Revert "Temporarily disable miri on doctests"
dtolnay Apr 8, 2024
3895493
Ignore cast_sign_loss pedantic clippy lint
dtolnay Apr 20, 2024
945f297
Ignore cast_possible_wrap pedantic clippy lint
dtolnay Apr 20, 2024
acaa839
Upload CI Cargo.lock for reproducing failures
dtolnay Aug 25, 2024
6c84006
Prevent upload-artifact step from causing CI failure
dtolnay Nov 9, 2024
72361cb
Add Integer::MAX_STR_LEN and use it to tell the compiler about the ma…
Nov 20, 2024
e7b5808
Merge pull request #45 from SUPERCILEX/max-str-len
dtolnay Nov 20, 2024
63a8c86
Fix typo in MAX_STR_LEN documentation
dtolnay Nov 20, 2024
db0ce57
Touch up PR 45
dtolnay Nov 20, 2024
b21d9ca
Reword explanation of MAX_STR_LEN
dtolnay Nov 20, 2024
0d526bd
Match integer types as $:ty
dtolnay Nov 20, 2024
df33a85
Rename $conv_fn -> $large_unsigned
dtolnay Nov 20, 2024
c52d467
Tweak macro syntax
dtolnay Nov 20, 2024
b5415a8
Convert decimal digits lookup table to static
dtolnay Nov 20, 2024
0592667
Clarify platform sensitivity of MAX_STR_LEN
dtolnay Nov 20, 2024
d5a33e9
Merge pull request #47 from dtolnay/platform
dtolnay Nov 20, 2024
b45df1f
Release 1.0.12
dtolnay Nov 20, 2024
c4b3742
Convert to unsigned integer pointer offsets
dtolnay Nov 20, 2024
9b3e148
Merge pull request #48 from dtolnay/usize
dtolnay Nov 20, 2024
9f83888
Make macros formattable by rustfmt
dtolnay Nov 20, 2024
acf0029
Merge pull request #49 from dtolnay/fmt
dtolnay Nov 20, 2024
cf17729
Forward isize/usize to other primitive implementation
dtolnay Nov 20, 2024
486eb76
Merge pull request #50 from dtolnay/size
dtolnay Nov 20, 2024
80fc2dd
Eliminate top-level MAX_LEN constants
dtolnay Nov 20, 2024
c4ba250
Merge pull request #51 from dtolnay/maxlen
dtolnay Nov 20, 2024
21e76dc
Remove redundant size_of check
dtolnay Nov 20, 2024
535f396
Merge pull request #52 from dtolnay/fouratatime
dtolnay Nov 20, 2024
daf766b
Replace 'decode' terminology with 'render'
dtolnay Nov 20, 2024
d39d767
Merge pull request #53 from dtolnay/render
dtolnay Nov 20, 2024
09a06f6
Change decimal digits lookup table from static to const
dtolnay Nov 20, 2024
513debf
Merge pull request #54 from dtolnay/lut
dtolnay Nov 20, 2024
ed2b9b4
Eliminate 64-bit-to-isize conversion
dtolnay Nov 20, 2024
3118ea6
Merge pull request #55 from dtolnay/isize
dtolnay Nov 20, 2024
d49fc1d
Release 1.0.13
dtolnay Nov 20, 2024
d2f97a8
Try to prevent Integer<Buffer = ...> IDE suggestion
dtolnay Nov 25, 2024
6f07cf6
Merge pull request #56 from dtolnay/hidebuffer
dtolnay Nov 25, 2024
7e6b258
Release 1.0.14
dtolnay Nov 25, 2024
758499d
More precise gitignore patterns
dtolnay Jan 23, 2025
94fea8f
Unset doc-scrape-examples for lib target
dtolnay Feb 10, 2025
ecc7fae
Convert html links to intra-doc links
dtolnay Feb 20, 2025
a136ce8
Point standard library links to stable
dtolnay Feb 20, 2025
e2766b8
Release 1.0.15
dtolnay Mar 3, 2025
1ca7e00
Pin nightly toolchain used for miri job
dtolnay May 17, 2025
7eacfee
Revert "Pin nightly toolchain used for miri job"
dtolnay Aug 8, 2025
a565d21
Update actions/checkout@v4 -> v5
dtolnay Aug 23, 2025
e84a87e
Update benchmark with Rust nightly-2025-09-01 and itoa 1.0.15
dtolnay Sep 1, 2025
5cd6218
Merge pull request #60 from dtolnay/bench
dtolnay Sep 1, 2025
b1ae778
Opt in to generate-macro-expansion when building on docs.rs
dtolnay Sep 16, 2025
6e71a7c
Relocate clippy non_canonical_clone_impl suppression
dtolnay Oct 18, 2025
55ab251
Remove link to closed clippy issue
dtolnay Oct 18, 2025
66cf3fe
Update actions/checkout@v5 -> v6
dtolnay Nov 20, 2025
5ea64bd
Remove rustc version requirement from readme
dtolnay Dec 13, 2025
6f68830
Raise required compiler to Rust 1.38
dtolnay Dec 14, 2025
3182793
Resolve ptr_as_ptr pedantic clippy lint
dtolnay Dec 14, 2025
f961ca4
Raise required compiler to Rust 1.43
dtolnay Dec 14, 2025
92a899d
Resolve legacy_numeric_contants clippy lint
dtolnay Dec 14, 2025
065fa74
Raise required compiler to Rust 1.51
dtolnay Dec 14, 2025
e205936
Resolve borrow_as_ptr pedantic clippy lints
dtolnay Dec 14, 2025
bec326b
Raise required compiler to Rust 1.68
dtolnay Dec 14, 2025
ccda854
Update to 2021 edition
dtolnay Dec 14, 2025
741bca0
Switch from test::black_box to std::hint::black_box
dtolnay Dec 19, 2025
6544993
Update actions/upload-artifact@v4 -> v5
dtolnay Dec 19, 2025
32eff83
Update actions/upload-artifact@v5 -> v6
dtolnay Dec 20, 2025
afd36af
Switch from cargo bench to criterion
dtolnay Dec 20, 2025
0960ce7
Resolve cast_lossless pedantic clippy lint
dtolnay Dec 20, 2025
7f68977
Remove suppression of cast_possible_wrap that is no longer triggered
dtolnay Dec 20, 2025
bbba1c2
Add test of MAX_STR_LEN
dtolnay Dec 20, 2025
b150860
Add formula for MAX_STR_LEN
dtolnay Dec 20, 2025
78cc52f
Merge pull request #64 from dtolnay/formula
dtolnay Dec 20, 2025
2a261f9
Sync algorithm from rust-lang/rust master
dtolnay Dec 20, 2025
10268e8
Fix no-panic
dtolnay Dec 20, 2025
0e19215
Restore support for rustc older than 1.93
dtolnay Dec 20, 2025
9e42c31
Restore support for rustc older than 1.81
dtolnay Dec 20, 2025
548f094
Restore support for rustc older than 1.80
dtolnay Dec 20, 2025
e4a9927
Restore support for rustc older than 1.77
dtolnay Dec 20, 2025
7d6c081
Ignore identity_op clippy lint
dtolnay Dec 20, 2025
02cc21b
Ignore items_after_statements pedantic clippy lint
dtolnay Dec 20, 2025
e4e4b3c
Align decimal pairs to 2 bytes
dtolnay Dec 21, 2025
200d064
Delete unreachable_unchecked hints
dtolnay Dec 21, 2025
1087e9d
Remove DECIMAL_PAIRS bounds checks
dtolnay Dec 21, 2025
bae1746
Copy fast divmod100 from zmij
dtolnay Dec 21, 2025
997a4ef
Write last digit without table lookup
dtolnay Dec 21, 2025
4394758
Update benchmark chart
dtolnay Dec 21, 2025
83539d1
Ignore cast_lossless pedantic clippy lint
dtolnay Dec 21, 2025
bb76a9c
Update libcore implementation links
dtolnay Dec 21, 2025
2c7311b
Merge pull request #65 from dtolnay/up
dtolnay Dec 21, 2025
2e6134d
Exclude benchmark dependencies from being compiled by miri
dtolnay Dec 21, 2025
4c18677
Release 1.0.16
dtolnay Dec 21, 2025
2dff249
Set repr(C) on DECIMAL_PAIRS
dtolnay Dec 25, 2025
cf33343
Update ryu links to zmij
dtolnay Dec 27, 2025
55c15a1
Use performance chart from itoa-benchmark
dtolnay Dec 27, 2025
21d6109
Release 1.0.17
dtolnay Dec 27, 2025
65bc721
Delete old chart code
dtolnay Dec 27, 2025
bbf077f
Switch to 9975WX benchmark data
dtolnay Jan 17, 2026
29b3410
Simplify pointer usage in Buffer::format method
xtqqczze Feb 2, 2026
e693c49
Merge pull request #67 from xtqqczze/as_mut_ptr
dtolnay Feb 2, 2026
0d8a489
Fill in pointer cast type
dtolnay Feb 2, 2026
7b4c86b
Optimize 128-bit integer formatting
jhpratt Mar 19, 2026
73a7c03
Merge pull request #68 from jhpratt/master
dtolnay Mar 20, 2026
af77385
Release 1.0.18
dtolnay Mar 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: dtolnay
126 changes: 126 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
name: CI

on:
push:
pull_request:
workflow_dispatch:
schedule: [cron: "40 1 * * *"]

permissions:
contents: read

env:
RUSTFLAGS: -Dwarnings

jobs:
pre_ci:
uses: dtolnay/.github/.github/workflows/pre_ci.yml@master

test:
name: Rust ${{matrix.rust}}
needs: pre_ci
if: needs.pre_ci.outputs.continue
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust: [nightly, beta, stable, 1.86.0]
timeout-minutes: 45
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{matrix.rust}}
- name: Enable type layout randomization
run: echo RUSTFLAGS=${RUSTFLAGS}\ -Zrandomize-layout >> $GITHUB_ENV
if: matrix.rust == 'nightly'
- run: cargo build
- run: cargo test
- run: cargo test --release
- run: cargo build --no-default-features
- run: cargo test --tests --no-default-features
- run: cargo test --tests --no-default-features --release
- run: cargo build --tests --features no-panic --release
if: matrix.rust == 'nightly'
- run: cargo bench --no-run
if: matrix.rust == 'nightly'
- uses: actions/upload-artifact@v6
if: matrix.rust == 'nightly' && always()
with:
name: Cargo.lock
path: Cargo.lock
continue-on-error: true

msrv:
name: Rust 1.68.0
needs: pre_ci
if: needs.pre_ci.outputs.continue
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@1.68
- run: cargo build
- run: cargo build --no-default-features

doc:
name: Documentation
needs: pre_ci
if: needs.pre_ci.outputs.continue
runs-on: ubuntu-latest
timeout-minutes: 45
env:
RUSTDOCFLAGS: -Dwarnings
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@nightly
- uses: dtolnay/install@cargo-docs-rs
- run: cargo docs-rs

miri:
name: Miri
needs: pre_ci
if: needs.pre_ci.outputs.continue
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@miri
- run: cargo miri setup
- run: cargo miri test
env:
MIRIFLAGS: -Zmiri-strict-provenance

clippy:
name: Clippy
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
timeout-minutes: 45
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@clippy
- run: cargo clippy --tests --benches -- -Dclippy::all -Dclippy::pedantic

fuzz:
name: Fuzz
needs: pre_ci
if: needs.pre_ci.outputs.continue
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@nightly
- uses: dtolnay/install@cargo-fuzz
- run: cargo fuzz check

outdated:
name: Outdated
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
timeout-minutes: 45
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- uses: dtolnay/install@cargo-outdated
- run: cargo outdated --workspace --exit-code 1
- run: cargo outdated --manifest-path fuzz/Cargo.toml --exit-code 1
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
target
Cargo.lock
/target/
/Cargo.lock
28 changes: 0 additions & 28 deletions .travis.yml

This file was deleted.

38 changes: 26 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,33 @@
[package]
name = "itoa"
version = "0.4.5" # remember to update html_root_url
version = "1.0.18"
authors = ["David Tolnay <dtolnay@gmail.com>"]
categories = ["value-formatting", "no-std", "no-std::no-alloc"]
description = "Fast integer primitive to string conversion"
documentation = "https://docs.rs/itoa"
edition = "2021"
exclude = ["*.png"]
keywords = ["integer"]
license = "MIT OR Apache-2.0"
description = "Fast functions for printing integer primitives to an io::Write"
repository = "https://github.com/dtolnay/itoa"
documentation = "https://github.com/dtolnay/itoa"
categories = ["value-formatting"]
readme = "README.md"
exclude = ["performance.png"]
rust-version = "1.68"

[features]
default = ["std"]
i128 = []
std = []
[dependencies]
no-panic = { version = "0.1", optional = true }

[badges]
travis-ci = { repository = "dtolnay/itoa" }
[target.'cfg(not(miri))'.dev-dependencies]
criterion = { version = "0.8", default-features = false }

[[bench]]
name = "bench"
harness = false

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
rustdoc-args = [
"--generate-link-to-definition",
"--generate-macro-expansion",
"--extern-html-root-url=core=https://doc.rust-lang.org",
"--extern-html-root-url=alloc=https://doc.rust-lang.org",
"--extern-html-root-url=std=https://doc.rust-lang.org",
]
25 changes: 0 additions & 25 deletions LICENSE-APACHE
Original file line number Diff line number Diff line change
Expand Up @@ -174,28 +174,3 @@ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
82 changes: 26 additions & 56 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,81 +1,51 @@
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&logo=docs.rs" height="20">](https://docs.rs/itoa)
[<img alt="build status" src="https://img.shields.io/github/actions/workflow/status/dtolnay/itoa/ci.yml?branch=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
[libcore] but avoids the performance penalty of going through
[`fmt::Formatter`].
This crate provides a fast conversion of integer primitives to decimal strings.
The implementation comes straight from [libcore] but avoids the performance
penalty of going through [`core::fmt::Formatter`].

See also [`dtoa`] for printing floating point primitives.
See also [`zmij`] for printing floating point primitives.

*Version requirement: rustc 1.0+*

[`io::Write`]: https://doc.rust-lang.org/std/io/trait.Write.html
[`fmt::Write`]: https://doc.rust-lang.org/core/fmt/trait.Write.html
[libcore]: https://github.com/rust-lang/rust/blob/b8214dc6c6fc20d0a660fb5700dca9ebf51ebe89/src/libcore/fmt/num.rs#L201-L254
[`fmt::Formatter`]: https://doc.rust-lang.org/std/fmt/struct.Formatter.html
[`dtoa`]: https://github.com/dtolnay/dtoa
[libcore]: https://github.com/rust-lang/rust/blob/1.92.0/library/core/src/fmt/num.rs#L190-L253
[`core::fmt::Formatter`]: https://doc.rust-lang.org/std/fmt/struct.Formatter.html
[`zmij`]: https://github.com/dtolnay/zmij

```toml
[dependencies]
itoa = "0.4"
itoa = "1.0"
```

<br>

## Performance (lower is better)

![performance](https://raw.githubusercontent.com/dtolnay/itoa/master/performance.png)

<br>

## Examples
## Example

```rust
use std::{fmt, io};

fn demo_itoa_write() -> io::Result<()> {
// Write to a vector or other io::Write.
let mut buf = Vec::new();
itoa::write(&mut buf, 128u64)?;
println!("{:?}", buf);

// Write to a stack buffer.
let mut bytes = [0u8; 20];
let n = itoa::write(&mut bytes[..], 128u64)?;
println!("{:?}", &bytes[..n]);

Ok(())
}

fn demo_itoa_fmt() -> fmt::Result {
// Write to a string.
let mut s = String::new();
itoa::fmt(&mut s, 128u64)?;
println!("{}", s);

Ok(())
fn main() {
let mut buffer = itoa::Buffer::new();
let printed = buffer.format(128u64);
assert_eq!(printed, "128");
}
```

The function signatures are:
<br>

```rust
fn write<W: io::Write, V: itoa::Integer>(writer: W, value: V) -> io::Result<usize>;
## Performance

fn fmt<W: fmt::Write, V: itoa::Integer>(writer: W, value: V) -> fmt::Result;
```
The [itoa-benchmark] compares this library and other Rust integer formatting
implementations across a range of integer sizes. The vertical axis in this chart
shows nanoseconds taken by a single execution of
`itoa::Buffer::new().format(value)` so a lower result indicates a faster
library.

where `itoa::Integer` is implemented for i8, u8, i16, u16, i32, u32, i64, u64,
i128, u128, isize and usize. 128-bit integer support requires rustc 1.26+ and
the `i128` feature of this crate enabled.
[itoa-benchmark]: https://github.com/dtolnay/itoa-benchmark

The `write` function is only available when the `std` feature is enabled
(default is enabled). The return value gives the number of bytes written.
![performance](https://raw.githubusercontent.com/dtolnay/itoa/master/itoa-benchmark.png)

<br>

Expand Down
Loading