Shouldn't test
vanish after going out of the scope? Why can println!
still print the value of test
?
fn skip<'a>(line: &'a str, _prefix: &'a str) -> &'a str {
line
}
fn main() {
let line = "aaa";
let q;
{
let test = "bbb";
q = skip(test, line);
}
println!("{}", q);
}