pub fn filter_non_characters(string: &str) -> String {
    let mut output = String::with_capacity(string.len()+5);
    for c in string.chars() {
        match c {
            '\'' | '"' | '\\' | '<' | '>' => {},
            _ => match gc::of(c) {
                    gc::OtherSymbol |
                    gc::SpaceSeparator |
                    gc::LineSeparator |
                    gc::ParagraphSeparator |
                    gc::Control |
                    gc::Format |
                    gc::Surrogate |
                    gc::PrivateUse |
                    gc::Unassigned 
                        => {},
                      _ => output.push(c),
            },
        }
    }
    output
}
/// Filters out separators, control codes, unicode surrogates, and a few others
/// as well as single/double quotes, backslashes, and angle braces.
///
/// This is used mainly for passwords/usernames and other user input that
/// should be sanitized without using with the `htmlescape` crate
Filters out separators, control codes, unicode surrogates, and a few others
as well as single/double quotes, backslashes, and angle braces.

This is used mainly for passwords/usernames and other user input that
should be sanitized without using with the `htmlescape` crate
Filters out separators control codes unicode surrogates and a few others as well as single / double quotes backslashes and angle braces . This is used mainly for passwords / usernames and other user input that should be sanitized without using with the ` htmlescape ` crate
pub fn filter_non_characters(string: &str) -> String {
    let mut output = String::with_capacity(string.len()+5);
    for c in string.chars() {
        match c {
            '\'' | '"' | '\\' | '<' | '>' => {},
            _ => match gc::of(c) {
                    gc::OtherSymbol |
                    gc::SpaceSeparator |
                    gc::LineSeparator |
                    gc::ParagraphSeparator |
                    gc::Control |
                    gc::Format |
                    gc::Surrogate |
                    gc::PrivateUse |
                    gc::Unassigned 
                        => {},
                      _ => output.push(c),
            },
        }
    }
    output
}
pub fn filter_non_characters ( string : & str ) -> String { let mut output = String :: with_capacity ( string . len ( ) + 5 ) ; for c in string . chars ( ) { match c { '\'' | '"' | '\\' | '<' | '>' => { } , _ => match gc :: of ( c ) { gc :: OtherSymbol | gc :: SpaceSeparator | gc :: LineSeparator | gc :: ParagraphSeparator | gc :: Control | gc :: Format | gc :: Surrogate | gc :: PrivateUse | gc :: Unassigned => { } , _ => output . push ( c ) , } , } } output }
Filters out separators, control codes, unicode surrogates, and a few others
as well as single/double quotes, backslashes, and angle braces.
Filters out separators control codes unicode surrogates and a few others as well as single / double quotes backslashes and angle braces .
string
&str
string
&str