too-many-lists/ok-stack/itermut #945
Replies: 2 comments 12 replies
-
看到这里,我小小记录下心得: 建议多看看生命周期和所有权和借用这两个章节,通过小项目练手形成记忆。 |
Beta Was this translation helpful? Give feedback.
3 replies
-
“原因在于有些类型可以 Copy,有些不行。而Option 和不可变引用 &T 恰恰是可以 Copy 的,但尴尬的是,可变引用 &mut T 不可以,因此这里报错了。” 没懂,哥哥们, fn next(&mut self) -> Option<Self::Item> {
self.next.map(|node| {
self.next = node.next.as_deref_mut();
&mut node.elem
})
} 这里的 |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
too-many-lists/ok-stack/itermut
https://course.rs/too-many-lists/ok-stack/itermut.html
Beta Was this translation helpful? Give feedback.
All reactions