blob: 4e45633a281cb2db9b6dc5b68a7e8d6c9f188358 (
plain)
1
2
3
4
5
6
7
8
9
|
fn read_lines_borrowed<'a>() -> Vec<&'a str> {
let raw_lines: Vec<String> = vec!["foo ".to_string(), " bar".to_string()];
raw_lines.iter().map(|l| l.trim()).collect()
//~^ ERROR `raw_lines` does not live long enough
}
fn main() {
println!("{:?}", read_lines_borrowed());
}
|