Closed pierd closed 2 years ago
@ndmitchell has anything changed in ci checks? I've noticed that clippy found a lot of problems that are not related to changes in this PR.
The clippy changes are partly due to nightly clippy detecting more things, and partly due to code changes. I think we're down to one in the latest HEAD, as I was working on it yesterday. Don't worry too much - we have a set of lints we apply internally too, so that will catch the ones we care about.
@ndmitchell has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@ndmitchell merged this pull request in facebookexperimental/starlark-rust@8c89e4d4fab33168a2bd391dcca58023c07bf045.
Thanks for the code! All landed and most appreciated!
In internal code review we debated powf
vs powi
for a while, before realising powi
in Rust is totally broken - https://github.com/rust-lang/rust/issues/71355#issuecomment-943258728. I also flipped from a Vec to an [u8; 6]
so that we save a malloc in printing, at someones request. There was an additional test case too. But very minor tweaks.
Yeah, I learned about powi
the hard way too (that's what I used initially). Great idea to use [u8; 6]
instead of a Vec
since we know the max size during compilation anyway 🎉
Happy to help as always
Addresses: https://github.com/facebookexperimental/starlark-rust/issues/3 Spec: https://github.com/bazelbuild/starlark/blob/689f54426951638ef5b7c41a14d8fc48e65c5f77/spec.md#string-interpolation
Changes:
float::write_{decimal,scientific,compact}
functions for various kinds of string interpolation for floatsDisplay for StarlarkFloat
usewrite_compact
(as per spec)write_*
functions