fn int_to_digits(value: i32) -> Vec<u32> {
    let mut value_string = value.abs().to_string();

    if value_string.len() < 4 {
        let mut new_string = String::from("");
        for _ in 0..4 - value_string.len() {
            new_string.push_str("0");
        }
        new_string.push_str(&value_string);
        value_string = new_string;
    }

    value_string
        .chars()
        .map(|d| d.to_digit(10).unwrap())
        .collect::<Vec<u32>>()
}
/// Splits a value into a vec of its digits. Throws away the sign, and
/// pads so that there are always exactly 4 digits.
Splits a value into a vec of its digits. Throws away the sign, and
pads so that there are always exactly 4 digits.
Splits a value into a vec of its digits . Throws away the sign and pads so that there are always exactly 4 digits .
fn int_to_digits(value: i32) -> Vec<u32> {
    let mut value_string = value.abs().to_string();
    if value_string.len() < 4 {
        let mut new_string = String::from("");
        for _ in 0..4 - value_string.len() {
            new_string.push_str("0");
        }
        new_string.push_str(&value_string);
        value_string = new_string;
    }
    value_string
        .chars()
        .map(|d| d.to_digit(10).unwrap())
        .collect::<Vec<u32>>()
}
fn int_to_digits ( value : i32 ) -> Vec < u32 > { let mut value_string = value . abs ( ) . to_string ( ) ; if value_string . len ( ) < 4 { let mut new_string = String :: from ( " " ) ; for _ in 0 .. 4 - value_string . len ( ) { new_string . push_str ( " " ) ; } new_string . push_str ( & value_string ) ; value_string = new_string ; } value_string . chars ( ) . map ( | d | d . to_digit ( 10 ) . unwrap ( ) ) . collect :: < Vec < u32 > > ( ) }
Splits a value into a vec of its digits.
Splits a value into a vec of its digits .
value
i32
value
i32