2019-12-24 12:14:20 -06:00
|
|
|
struct List {
|
|
|
|
data: Vec<String>,
|
|
|
|
}
|
|
|
|
impl List {
|
|
|
|
fn started_with<'a>(&'a self, prefix: &'a str) -> impl Iterator<Item=&'a str> {
|
|
|
|
self.data.iter().filter(|s| s.starts_with(prefix)).map(|s| s.as_ref())
|
2020-04-07 16:57:26 -05:00
|
|
|
//~^ ERROR E0373
|
2019-12-24 12:14:20 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|