Closed amab8901 closed 1 month ago
This is outside the scope of our library as split_vec
would be a String
method and not an iterator one.
If this is something you do a lot then you can write your own trait, something like (untested but seems legit to me)
trait StringExt: AsRef<str> {
fn split_vec(&self, sep: char) -> Vec<String> {
self.as_ref().split(sep).map(String::from).collect()
}
}
impl<T: ?Sized + AsRef<str>> StringExt for T {}
current code:
desired code: