I would like to create a sorted word from a String
Here is what I have so far.
fn sort_word(word: &str) -> String {
word.chars()
.collect::<Vec<char>>()
.sort_unstable()
.iter()
.collect()
}
I do not understand the compiler message :
error[E0599]: no method named `iter` found for unit type `()` in the current scope
--> src/lib.rs:5:10
|
5 | .iter()
| ^^^^ method not found in `()`
What am I doing wrong here?