mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-11-03 22:49:17 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			12 lines
		
	
	
		
			261 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			12 lines
		
	
	
		
			261 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
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())
 | 
						|
        //~^ ERROR E0373
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
fn main() {}
 |