pub fn sanitize_text(input: &[u8]) -> Result<Vec<AsciiUppercaseByte>, errors::Error> {
    // Uppercase everything
    let uppercased = input.to_ascii_uppercase();

    // Remove any non-alphabetic characters
    let filtered = uppercased.into_iter()
                                .filter(|&elem| { elem >= b'A' && elem <= b'Z' })
                                .map(|elem| Ok(AsciiUppercaseByte::try_from(elem)?))
                                .collect::<Result<Vec<AsciiUppercaseByte>, errors::Error>>();

    filtered
}
/// Uppercases, and removes any non-alphabetic characters from the text
Uppercases, and removes any non-alphabetic characters from the text
Uppercases and removes any non - alphabetic characters from the text
pub fn sanitize_text(input: &[u8]) -> Result<Vec<AsciiUppercaseByte>, errors::Error> {
    // Uppercase everything
    let uppercased = input.to_ascii_uppercase();
    // Remove any non-alphabetic characters
    let filtered = uppercased.into_iter()
                                .filter(|&elem| { elem >= b'A' && elem <= b'Z' })
                                .map(|elem| Ok(AsciiUppercaseByte::try_from(elem)?))
                                .collect::<Result<Vec<AsciiUppercaseByte>, errors::Error>>();
    filtered
}
pub fn sanitize_text ( input : & [ u8 ] ) -> Result < Vec < AsciiUppercaseByte > , errors :: Error > { // Uppercase everything let uppercased = input . to_ascii_uppercase ( ) ; // Remove any non-alphabetic characters let filtered = uppercased . into_iter ( ) . filter ( | & elem | { elem >= b'A' && elem <= b'Z' } ) . map ( | elem | Ok ( AsciiUppercaseByte :: try_from ( elem ) ? ) ) . collect :: < Result < Vec < AsciiUppercaseByte > , errors :: Error > > ( ) ; filtered }
Uppercases, and removes any non-alphabetic characters from the text
Uppercases and removes any non - alphabetic characters from the text
input
&[u8]
input
&[u8]