From 8232c6cd5160413bf740c0af1fddadde369e5299 Mon Sep 17 00:00:00 2001 From: KAMADA Ken'ichi Date: Tue, 4 May 2021 22:12:47 +0900 Subject: [PATCH] Deprecate impl From<{Rational,SRational}> for {f64,f32}. The #[deprecated] attribute does not work on impl items, so comments have been added. --- src/value.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/value.rs b/src/value.rs index fe0c1f8..86d844f 100644 --- a/src/value.rs +++ b/src/value.rs @@ -333,11 +333,13 @@ impl fmt::Display for Rational { } } +// This implementation has been deprecated. Use Rational::to_f64 instead. impl From for f64 { #[inline] fn from(r: Rational) -> f64 { r.to_f64() } } +// This implementation has been deprecated. Use Rational::to_f32 instead. impl From for f32 { #[inline] fn from(r: Rational) -> f32 { r.to_f32() } @@ -382,11 +384,13 @@ impl fmt::Display for SRational { } } +// This implementation has been deprecated. Use SRational::to_f64 instead. impl From for f64 { #[inline] fn from(r: SRational) -> f64 { r.to_f64() } } +// This implementation has been deprecated. Use SRational::to_f32 instead. impl From for f32 { #[inline] fn from(r: SRational) -> f32 { r.to_f32() }