too-many-lists/deque/peek #864
Replies: 6 comments 8 replies
-
为什么说Ref的生命周期和内部引用的生命周期不一致是必须的呢?怎么理解这个呢?是因为可能存在多个Ref对同一个内部引用的包裹,所以要将他们的生命周期分离吗? |
Beta Was this translation helpful? Give feedback.
-
如果使用idea来写rust代码,在这章节会遇到一个问题
其中node.borrow()的时候,idea会自动导入Borrow
clion可能也会存在这个问题
只要删除多余的use就可以保证使用我们现在需要的borrow |
Beta Was this translation helpful? Give feedback.
-
想问下, |
Beta Was this translation helpful? Give feedback.
-
测试函数中的assert_eq!(&*list.peek_front().unwrap(), &3); |
Beta Was this translation helpful? Give feedback.
-
assert_eq!(&*list.peek_front().unwrap(), &3); |
Beta Was this translation helpful? Give feedback.
-
经过测试,最终的函数签名 |
Beta Was this translation helpful? Give feedback.
-
too-many-lists/deque/peek
https://course.rs/too-many-lists/deque/peek.html
Beta Was this translation helpful? Give feedback.
All reactions