Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ keywords = [
license = "MIT"
readme = "README.md"
repository = "https://github.com/ferrilab/bitvec"
rust-version = "1.56"
rust-version = "1.81"

[features]
alloc = [
Expand Down
5 changes: 3 additions & 2 deletions src/vec/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,8 +540,9 @@ where
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
enum FillStatus {
/// The drain span is completely filled.
/// Note in this case, the replacement source may or may not be exhausted.
FullSpan = 0,
/// The replacement source is completely exhausted.
/// The replacement source is completely exhausted, but the drain span is not filled yet.
EmptyInput = 1,
}

Expand Down Expand Up @@ -682,7 +683,7 @@ where
self.drain.move_tail(len);
}
let filled = self.drain.fill(collected.by_ref());
debug_assert_eq!(filled, FillStatus::EmptyInput);
debug_assert_eq!(filled, FillStatus::FullSpan);
debug_assert_eq!(collected.len(), 0);
}
}
Expand Down
9 changes: 9 additions & 0 deletions src/vec/tests/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,13 @@ fn splice() {
let mut bv = bitvec![0, 1, 0, 0, 1];
drop(bv.splice(2 .. 2, Some(true)));
assert_eq!(bv, bits![0, 1, 1, 0, 0, 1]);

let mut bv = bitvec![0, 1, 0, 0, 1];
drop(bv.splice(
2 .. 2,
(0usize .. 2).flat_map(|index| {
let array = BitArray::<_, Lsb0>::from(index);
array.into_iter().take(2)
}),
));
}