Hi,
I'm wrapping my head around rust, I've read too many lists, and tried to implement some data structure myself. Here is my attempt, does it look good?
And I got few questions:
-
the book doesn't say anything about the scope of
match
, and during my attempt, I found the scope ofmatch
is counterintuitive, I can only useSome(_)
instead ofSome(mut cur)
inmatch
, because otherwise compiler would not allow assigning in None branch, why is that? - it seems rust borrow checker does not work well with loop: I can not eliminate the use of
cur
in loop, otherwise checker would confused and refuse to compile. This took me several hours to find out it's not my fault but checker's. Is there any way I can eliminatecur
?