dtolnay / ryu

Fast floating point to string conversion
Apache License 2.0
606 stars 27 forks source link

Is the str returned from `Buffer::format` guaranteed to be no longer than 24? #46

Closed NobodyXu closed 2 years ago

NobodyXu commented 2 years ago

Hi

I am implementing https://github.com/ParkMyCar/compact_str/pull/16 which uses ryu::Buffer::format to format f32 and f64 into CompactStr.

When looking at the code, I realized that in the current implementation, ryu::Buffer::format can return a string that is at most 24 bytes long.

I want to know if this is a behavior guaranteed to exist as long as no new major release happen.

Thanks in advance.

dtolnay commented 2 years ago

This is not guaranteed.

NobodyXu commented 2 years ago

Thanks!