dtolnay / ryu

Fast floating point to string conversion

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

NobodyXu opened this issue · comments

Hi

I am implementing ParkMyCar/compact_str#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.

This is not guaranteed.

Thanks!