Hey there,
I'm attempting to use Rust for some text processing, but am struggling to fully comprehend how I'd deal with the following.
I'm using the following:
sequence.chars().collect::,Vec<char>>().iter().collect::<Vec<_>>().windows(2);
To get all combinations of two characters, however I'm struggling to join the characters using the to_string()
method.
--> src/lib.rs:20:36
|
20 | println!("{:?}", slice.to_string());
| ^^^^^^^^^
|
= note: the method `to_string` exists but the following trait bounds were not satisfied:
`&[&char] : std::string::ToString`
`[&char] : std::string::ToString`
I don't even know what the type &[&char]
means - given the fact that there is certainly 2 characters in the given window, so I'm struggling to get my head around it.
Best wishes,
Keiron