changed into_iter to iter and fixed a lint check

This commit is contained in:
Maxwell Anderson 2018-11-04 10:39:54 -07:00
parent b6b97e5c1f
commit 3e0de1745d

View File

@ -229,20 +229,20 @@ impl<'a> DigitInfo<'a> {
None => String::new(),
};
format!("{}.{}{}", int_part_hint, frac_part_hint, suffix_hint)
} else if self.float && (self.digits.contains('E') || self.digits.contains('E')) {
} else if self.float && (self.digits.contains('E') || self.digits.contains('e')) {
let which_e = if self.digits.contains('E') { 'E' } else { 'e' };
let parts: Vec<&str> = self.digits.split(which_e).collect();
let filtered_digits_vec_0 = parts[0].chars().filter(|&c| c != '_').rev().collect::<Vec<_>>();
let filtered_digits_vec_1 = parts[1].chars().filter(|&c| c != '_').rev().collect::<Vec<_>>();
let before_e_hint = filtered_digits_vec_0
.chunks(group_size)
.map(|chunk| chunk.into_iter().rev().collect())
.map(|chunk| chunk.iter().rev().collect())
.rev()
.collect::<Vec<String>>()
.join("_");
let after_e_hint = filtered_digits_vec_1
.chunks(group_size)
.map(|chunk| chunk.into_iter().rev().collect())
.map(|chunk| chunk.iter().rev().collect())
.rev()
.collect::<Vec<String>>()
.join("_");