Open
Description
the following string will successfully reformat with rusfmt
let check = code.chars().rev().enumerate().filter(|(i, c)| c.is_digit(10)).try_fold(0u32, |sum, (i, c)| c.to_digit(10).map(|d| sum + if (i + 1) % 2 == 0 { if 2*d > 9 { 2*d - 9} else { 2*d }} else {d})).map_or(false, |sum| sum % 10 == 0);
and this one will not
code.chars().rev().enumerate().filter(|(i, c)| c.is_digit(10)).try_fold(0u32, |sum, (i, c)| c.to_digit(10).map(|d| if (i + 1) % 2 == 0 { if 2*d > 9 { 2*d - 9} else { 2*d }} else {d} + sum)).map_or(false, |sum| sum % 10 == 0);
the only difference being that sum was moved from the back of the if expression to the front.