Open dev-m1-macbook opened 10 months ago
The snippet you posted would be ok. If you leave off the semicolon of the last expression, the compiler will complain.
test test::peek ... ok
Shouldn't there be an additional *?
let elem: i32 = *list.peek_front().unwrap();
and do we really have to copy?
the following code errors with
list
does not live long enough error in rust 2021 editionbut the following code works: