uom
uom copied to clipboard
Implement f{32|64}::clamp
Stable in 1.50.0. How should support for the MSRV be done? Delay implementation?
https://blog.rust-lang.org/2021/02/11/Rust-1.50.0.html
An alternative would be to detect the rustc version via build.rs
and conditionally compile the implementation.
(uom
already transitively depends on autocfg
so this would be one way to do this without adding a new build dependency.)
autocfg
being a transitive dependency is a good point! I've been hesitant to add a build.rs
because compile times are bad enough.
I am toying with the idea of putting off any MSRV changes like this and jumping straight to 1.51 and min_const_generics
. I haven't really done much work on the conversion yet.
I am toying with the idea of putting off any MSRV changes like this and jumping straight to 1.51 and min_const_generics. I haven't really done much work on the conversion yet.
I am not sure that min_const_generics
will be a significant change for uom
as it does not include computation based on const type parameters which is sort of the point of compile time dimensional analysis, c.f. https://github.com/iliekturtles/uom/issues/134#issuecomment-751518357
Looking at the proof of concept again I see that it does require much more than just min_const_generics
: #![feature(const_generics, const_evaluatable_checked, doc_cfg)]
.
Exactly, at a minimum it needs the full const_generics
feature as it does computation based on const type parameters.
As mentioned in #376 I'm inclined to raise the MSRV at this point. 1.43.0 is from April 23, 2020. 1.50.0 is from February 11, 2021.
MSRV bumped to 1.60.0 in #422. I haven't started looking at this issue yet.