@@ -17,6 +17,7 @@ use prelude::*;
17
17
use cell:: { Cell , RefCell , Ref , RefMut , BorrowState } ;
18
18
use marker:: PhantomData ;
19
19
use mem;
20
+ #[ cfg( not( disable_float) ) ]
20
21
use num:: flt2dec;
21
22
use ops:: Deref ;
22
23
use result;
@@ -653,6 +654,7 @@ impl<'a> Formatter<'a> {
653
654
/// Takes the formatted parts and applies the padding.
654
655
/// Assumes that the caller already has rendered the parts with required precision,
655
656
/// so that `self.precision` can be ignored.
657
+ #[ cfg( not( disable_float) ) ]
656
658
fn pad_formatted_parts ( & mut self , formatted : & flt2dec:: Formatted ) -> Result {
657
659
if let Some ( mut width) = self . width {
658
660
// for the sign-aware zero padding, we render the sign first and
@@ -689,6 +691,7 @@ impl<'a> Formatter<'a> {
689
691
}
690
692
}
691
693
694
+ #[ cfg( not( disable_float) ) ]
692
695
fn write_formatted_parts ( & mut self , formatted : & flt2dec:: Formatted ) -> Result {
693
696
fn write_bytes ( buf : & mut Write , s : & [ u8 ] ) -> Result {
694
697
buf. write_str ( unsafe { str:: from_utf8_unchecked ( s) } )
@@ -1054,6 +1057,7 @@ impl<'a, T> Pointer for &'a mut T {
1054
1057
}
1055
1058
}
1056
1059
1060
+ #[ cfg( not( disable_float) ) ]
1057
1061
// Common code of floating point Debug and Display.
1058
1062
fn float_to_decimal_common < T > ( fmt : & mut Formatter , num : & T , negative_zero : bool ) -> Result
1059
1063
where T : flt2dec:: DecodableFloat
@@ -1078,6 +1082,7 @@ fn float_to_decimal_common<T>(fmt: &mut Formatter, num: &T, negative_zero: bool)
1078
1082
fmt. pad_formatted_parts ( & formatted)
1079
1083
}
1080
1084
1085
+ #[ cfg( not( disable_float) ) ]
1081
1086
// Common code of floating point LowerExp and UpperExp.
1082
1087
fn float_to_exponential_common < T > ( fmt : & mut Formatter , num : & T , upper : bool ) -> Result
1083
1088
where T : flt2dec:: DecodableFloat
0 commit comments