fn main() {
let x:String="ggg\nggg\nggg".to_owned();
let lines: Vec<&str> = x.split('\n').collect();
for i in lines{
println!("{}",i);
}
println!("{}",**(lines.get(0)));
}
I want to make a game and x is a map representation (g=grass...) and i need to know the char in specific spot for collision checking. How do i do it?
The code above returns:
error[E0614]: type Option<&&str> cannot be dereferenced