Skip to content

Add itoa crate to the list - #19

Merged
Turbo87 merged 2 commits into
rust-lang:mainfrom
GuillaumeGomez:itoa
Aug 24, 2026
Merged

Add itoa crate to the list#19
Turbo87 merged 2 commits into
rust-lang:mainfrom
GuillaumeGomez:itoa

Conversation

@GuillaumeGomez

Copy link
Copy Markdown
Member

No description provided.

@Urgau

Urgau commented Jun 16, 2026

Copy link
Copy Markdown
Member

cc @Turbo87

Comment thread data/itoa.toml
@Turbo87

Turbo87 commented Jun 16, 2026

Copy link
Copy Markdown
Member

also /cc @dtolnay as the maintainer of itoa. any objections or suggestions?

@Turbo87
Turbo87 marked this pull request as draft June 16, 2026 22:01
@rosymati

Copy link
Copy Markdown

I'm not affiliated with itoa, but I make heavy use of it and recently tried to move off it, so I'll add my two cents.

I don't think it's a full replacement, because of an API difference. With itoa I have one reusable Buffer that works for any integer, since format is generic over the integer type. NumBuffer puts the generic on the buffer instead (NumBuffer<T>), and format_into takes &mut NumBuffer<Self>, so the buffer is tied to the concrete type being formatted. That means you can't share one buffer across types; you need a separate NumBuffer<T> per integer type.

In my case I rely on a single reusable buffer fed values of different widths and signedness, and there's no way to express that with the std API as far as I can tell.

@GuillaumeGomez

Copy link
Copy Markdown
Member Author

I proposed it in rust-lang/rust#143636, but it was rejected. Might be worth opening an issue for that specifically in the rust repository. Don't forget to ping me and to link both rust-lang/rust#138215 and rust-lang/rust#143636 and to show your use-case.

@Turbo87

Turbo87 commented Aug 24, 2026

Copy link
Copy Markdown
Member

since 1.98 is release, I guess we can move forward with this now. should we soften the current message a bit to indicate that not all itoa functionality is covered by std yet? :)

@Turbo87
Turbo87 marked this pull request as ready for review August 24, 2026 08:52
@GuillaumeGomez

Copy link
Copy Markdown
Member Author

Is there a field for that or I just add it to the description?

@Turbo87

Turbo87 commented Aug 24, 2026

Copy link
Copy Markdown
Member

there is no structured field for this at the moment. you can just add it to the text.

@GuillaumeGomez

Copy link
Copy Markdown
Member Author

Modified the text to mention that the core API doesn't cover the whole itoa API.

@Turbo87 Turbo87 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great, thanks! :)

Comment thread data/itoa.toml Outdated
@Turbo87
Turbo87 merged commit edf628c into rust-lang:main Aug 24, 2026
2 checks passed
@GuillaumeGomez
GuillaumeGomez deleted the itoa branch August 24, 2026 11:51
@Turbo87

Turbo87 commented Aug 24, 2026

Copy link
Copy Markdown
Member
Bildschirmfoto 2026-08-24 um 13 52 10

now live at https://crates.io/crates/itoa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants