summaryrefslogtreecommitdiffstats
path: root/vendor/ryu/src/pretty
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/ryu/src/pretty')
-rw-r--r--vendor/ryu/src/pretty/mantissa.rs6
-rw-r--r--vendor/ryu/src/pretty/mod.rs3
2 files changed, 4 insertions, 5 deletions
diff --git a/vendor/ryu/src/pretty/mantissa.rs b/vendor/ryu/src/pretty/mantissa.rs
index 150c79c12..0149f5cff 100644
--- a/vendor/ryu/src/pretty/mantissa.rs
+++ b/vendor/ryu/src/pretty/mantissa.rs
@@ -43,7 +43,7 @@ pub unsafe fn write_mantissa_long(mut output: u64, mut result: *mut u8) {
#[cfg_attr(feature = "no-panic", inline)]
pub unsafe fn write_mantissa(mut output: u32, mut result: *mut u8) {
while output >= 10_000 {
- let c = (output - 10_000 * (output / 10_000)) as u32;
+ let c = output - 10_000 * (output / 10_000);
output /= 10_000;
let c0 = (c % 100) << 1;
let c1 = (c / 100) << 1;
@@ -60,7 +60,7 @@ pub unsafe fn write_mantissa(mut output: u32, mut result: *mut u8) {
result = result.offset(-4);
}
if output >= 100 {
- let c = ((output % 100) << 1) as u32;
+ let c = (output % 100) << 1;
output /= 100;
ptr::copy_nonoverlapping(
DIGIT_TABLE.as_ptr().offset(c as isize),
@@ -70,7 +70,7 @@ pub unsafe fn write_mantissa(mut output: u32, mut result: *mut u8) {
result = result.offset(-2);
}
if output >= 10 {
- let c = (output << 1) as u32;
+ let c = output << 1;
ptr::copy_nonoverlapping(
DIGIT_TABLE.as_ptr().offset(c as isize),
result.offset(-2),
diff --git a/vendor/ryu/src/pretty/mod.rs b/vendor/ryu/src/pretty/mod.rs
index b196a11b4..da49e863e 100644
--- a/vendor/ryu/src/pretty/mod.rs
+++ b/vendor/ryu/src/pretty/mod.rs
@@ -160,8 +160,7 @@ pub unsafe fn format32(f: f32, result: *mut u8) -> usize {
let bits = f.to_bits();
let sign = ((bits >> (FLOAT_MANTISSA_BITS + FLOAT_EXPONENT_BITS)) & 1) != 0;
let ieee_mantissa = bits & ((1u32 << FLOAT_MANTISSA_BITS) - 1);
- let ieee_exponent =
- ((bits >> FLOAT_MANTISSA_BITS) & ((1u32 << FLOAT_EXPONENT_BITS) - 1)) as u32;
+ let ieee_exponent = (bits >> FLOAT_MANTISSA_BITS) & ((1u32 << FLOAT_EXPONENT_BITS) - 1);
let mut index = 0isize;
if sign {