File: iter.md

package info (click to toggle)
rust-coreutils 0.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 505,620 kB
  • sloc: ansic: 103,594; asm: 28,570; sh: 8,910; python: 5,581; makefile: 472; cpp: 97; javascript: 72
file content (11 lines) | stat: -rw-r--r-- 544 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
# Boxed Bit-Slice Iteration

This module contains the by-value iterator used by both `BitBox` and `BitVec`.
In the standard library, this iterator is defined under `alloc::vec`, not
`alloc::boxed`, as `Box` already has an iteration implementation that forwards
to its boxed value.

It is moved here for simplicity: both `BitBox` and `BitVec` iterate over a
dynamic bit-slice by value, and must deƤllocate the region when dropped. As
`BitBox` has a smaller value than `BitVec`, it is used as the owning handle for
the bit-slice being iterated.