pub trait RoundFrom<T> {
fn round_from(x: T) -> Self;
}
This is our own implementation of a "lossy From" trait, representing
a conversion that can have precision loss. It is essentially adapted
from https://github.com/rust-lang/rfcs/pull/2484.
If and when such a trait is standardized, we should switch to that.
Alternatively, a case can be made it should move somewhere else, or
we should adopt a similar trait (it has some similarity to AsPrimitive
from num_traits).
Loading content...
Loading content...
impl<T> RoundFrom<T> for T | [src] |
Blanket implementation, no conversion needed.
Loading content...