fn validator(a: &str, l: usize) -> Result<(), PermitErr> {
    if a.len() != l {
        return Err(PermitErr::WrongLength {
            actual: a.len(),
            expected: l,
        });
    }
    if !a.chars().all(is_hex) {
        return Err(PermitErr::NonHex);
    }
    Ok(())
}
// checks length of string and that all characters are valid hex
checks length of string and that all characters are valid hex
checks length of string and that all characters are valid hex
fn validator(a: &str, l: usize) -> Result<(), PermitErr> {
    if a.len() != l {
        return Err(PermitErr::WrongLength {
            actual: a.len(),
            expected: l,
        });
    }
    if !a.chars().all(is_hex) {
        return Err(PermitErr::NonHex);
    }
    Ok(())
}
fn validator ( a : & str , l : usize ) -> Result < ( ) , PermitErr > { if a . len ( ) != l { return Err ( PermitErr :: WrongLength { actual : a . len ( ) , expected : l , } ) ; } if ! a . chars ( ) . all ( is_hex ) { return Err ( PermitErr :: NonHex ) ; } Ok ( ( ) ) }
checks length of string and that all characters are valid hex
checks length of string and that all characters are valid hex
a
&str
l
usize
a
&str
l
usize