too-many-lists/ok-stack/type-optimizing #1162
Replies: 4 comments 5 replies
-
impl Drop for List 为什么需要引入两个T,如果只是需要知道内存大小或者函数处理类型一个T不就可以? |
Beta Was this translation helpful? Give feedback.
2 replies
-
为什么不直接写 type List = Option<Box<Node>>
#[derive(Clone)]
struct Node {...} 呢? |
Beta Was this translation helpful? Give feedback.
2 replies
-
Option能用map本质是因为Option可以作为迭代器,具体可以看这个的介绍https://rust-unofficial.github.io/patterns/idioms/option-iter.html |
Beta Was this translation helpful? Give feedback.
1 reply
-
我有点不明白,为啥要手动impl Drop? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
too-many-lists/ok-stack/type-optimizing
https://course.rs/too-many-lists/ok-stack/type-optimizing.html
Beta Was this translation helpful? Give feedback.
All reactions