Check whether two strings are anagrams
There is no space before : in types.
There is a space after the return type
There is a space between function arguments, after the comma.
str::to_lowercase allocates a new string. It's a potential optimization to iterate through each character and convert to lowercase. Profiling should be done if performance matters.
Could use itertools sorted to reduce some boilerplate. Does the same thing under the hood.




extern crate itertools;
use itertools::Itertools;

/// Returns the sorted alphabetic symbols of a string in lowercase.
fn normalize(s: &amp;str) -&gt; Vec&lt;char&gt; {
    s.chars()
        .flat_map(char::to_lowercase)
        .filter(|c| c.is_alphabetic())
        .sorted()
}

/// Returns true if the sets of alphabetic symbols coincide.
pub fn is_anagram(a: &amp;str, b: &amp;str) -&gt; bool {
    normalize(a) == normalize(b)
}

#[test]
fn is_anagram_test() {
    assert!( is_anagram("Clint Eastwood", "Old West Action"));
    assert!( is_anagram("wisdom", "mid sow"));
    assert!(!is_anagram("Reddit", "Eat Dirt"));
    assert!( is_anagram("Schoolmaster", "The classroom"));
    assert!( is_anagram("Vacation Times", "I'm Not as Active"));
    assert!( is_anagram("12431b53c11a5324", "abc"));
}


Ultimately, you won't be able to achieve the same particular kind of elegance as the Haskell solution, but I'd hope that the performance would be better.