Find any issues in my Rust code based on the error message and the current code.
[Error message]
Line 40: Char 13: error: cannot assign to tmp because it is borrowed (solution.rs)
|
40 | tmp = curr.as_mut().unwrap().next.take();
| ^^^ tmp is assigned to here but it was already borrowed
41 | curr = &mut tmp;
| -------- tmp is borrowed here