dtolnay / itoa

Fast function for printing integer primitives to a decimal string
Apache License 2.0
306 stars 37 forks source link

Thoughts on adding a MAX_STR_LEN param to the Integer trait? #44

Closed SUPERCILEX closed 3 days ago

SUPERCILEX commented 4 days ago

https://github.com/bytecodealliance/rustix/pull/1201/files#diff-0c1bf5756f1b043ec04ef125becca3922c5dd96e503c83dc1584649167f04d00R55

Over in rustix we're trying to move some buffers to maybe uninit. Unfortunately, knowing how big a buffer will be results in really ugly code (see link above), so I'd like to propose two changes to make unsafe code easier to write with itoa:

cc @sunfishcode

dtolnay commented 3 days ago

Yes, I would welcome a PR for this.