Document Deque trait and bitv.#15824
Document Deque trait and bitv.#15824treeman wants to merge 12 commits intorust-lang:masterfrom treeman:deque-bitv-doc
Conversation
src/libcollections/bitv.rs
Outdated
|
That's interesting. I moved some functions to group them more logically, but it appears github renders them as if I rewrote them. I'll see if I can split up the commits. |
src/libcollections/bitv.rs
Outdated
There was a problem hiding this comment.
same as above. I'm also not quite sure whether #[inline] should live above comments, probably not.
|
I know it's a bit laborious, but would makes it easier to review and blame or bisect 👍 |
|
Yes I totally understand, no worries. |
src/libcollections/bitv.rs
Outdated
There was a problem hiding this comment.
// mark all multiples of i as non-prime (any multiples below i * i
// will have been marked as non-prime previously)
for j in iter::range(i * i, max_prime, i) { bv.set(j, false) }
src/libcollections/bitv.rs
Outdated
There was a problem hiding this comment.
What is false divided by 0? :P
Maybe just false (with backticks) is enough?
So all comes in the order union, intersection, difference and symmetric_difference.
src/libcollections/lib.rs
Outdated
There was a problem hiding this comment.
FWIW, you can efficiently implement a stack with just Vec (via .push and .pop), no need for Deque or RingBuf. Maybe this could be moved to after the queue example?
Examples for
Deque,BitvandBitvSet. Normalize documentation style and some source code reorganization.