From ccbbf3eb346c3d44033fce74c45fe1d99c2de6fc Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Sun, 11 Apr 2021 11:20:34 +0800 Subject: [PATCH] Enhance floating-point display. --- src/ast.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ast.rs b/src/ast.rs index d7b50786..074021bf 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -1496,10 +1496,10 @@ impl crate::stdlib::ops::DerefMut for FloatWrapper { } #[cfg(not(feature = "no_float"))] -impl fmt::Debug for FloatWrapper { +impl fmt::Debug for FloatWrapper { #[inline(always)] fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt::Display::fmt(&self.0, f) + fmt::Debug::fmt(&self.0, f) } } @@ -1641,10 +1641,10 @@ impl fmt::Debug for Expr { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { Self::DynamicConstant(value, pos) => write!(f, "{:?} @ {:?}", value, pos), - Self::BoolConstant(value, pos) => write!(f, "{} @ {:?}", value, pos), - Self::IntegerConstant(value, pos) => write!(f, "{} @ {:?}", value, pos), + Self::BoolConstant(value, pos) => write!(f, "{:?} @ {:?}", value, pos), + Self::IntegerConstant(value, pos) => write!(f, "{:?} @ {:?}", value, pos), #[cfg(not(feature = "no_float"))] - Self::FloatConstant(value, pos) => write!(f, "{} @ {:?}", value, pos), + Self::FloatConstant(value, pos) => write!(f, "{:?} @ {:?}", value, pos), Self::CharConstant(value, pos) => write!(f, "{:?} @ {:?}", value, pos), Self::StringConstant(value, pos) => write!(f, "{:?} @ {:?}", value, pos), Self::FnPointer(value, pos) => write!(f, "Fn({:?}) @ {:?}", value, pos),