浏览代码

Fix clippy::assign_op_pattern

Josh Stone 3 年之前
父节点
当前提交
a8812c176c
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      src/lib.rs

+ 4 - 4
src/lib.rs

@@ -279,13 +279,13 @@ macro_rules! float_trait_impl {
                     match c.to_digit(radix) {
                     match c.to_digit(radix) {
                         Some(digit) => {
                         Some(digit) => {
                             // shift significand one digit left
                             // shift significand one digit left
-                            sig = sig * (radix as $t);
+                            sig *= radix as $t;
 
 
                             // add/subtract current digit depending on sign
                             // add/subtract current digit depending on sign
                             if is_positive {
                             if is_positive {
-                                sig = sig + ((digit as isize) as $t);
+                                sig += (digit as isize) as $t;
                             } else {
                             } else {
-                                sig = sig - ((digit as isize) as $t);
+                                sig -= (digit as isize) as $t;
                             }
                             }
 
 
                             // Detect overflow by comparing to last value, except
                             // Detect overflow by comparing to last value, except
@@ -327,7 +327,7 @@ macro_rules! float_trait_impl {
                         match c.to_digit(radix) {
                         match c.to_digit(radix) {
                             Some(digit) => {
                             Some(digit) => {
                                 // Decrease power one order of magnitude
                                 // Decrease power one order of magnitude
-                                power = power / (radix as $t);
+                                power /= radix as $t;
                                 // add/subtract current digit depending on sign
                                 // add/subtract current digit depending on sign
                                 sig = if is_positive {
                                 sig = if is_positive {
                                     sig + (digit as $t) * power
                                     sig + (digit as $t) * power