ferrilab / bitvec

A crate for managing memory bit by bit
https://myrrlyn.net/crates/bitvec
MIT License
1.22k stars 115 forks source link

Mutable indexing doesn't seem to work #278

Open nazar-pc opened 2 months ago

nazar-pc commented 2 months ago

I use BitArray<[u8; _]> as a container and then trying to index into it.

Immutable indexing to return &bool works just fine, but attempt to return &mut bool fails:

218 |         &mut self.encoded_record_chunks_used[index]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot borrow as mutable
    |
    = help: trait `IndexMut` is required to modify indexed content, but it is not implemented for `bitvec::array::BitArray<[u8; 8192]>`

Not sure what the reason of this is, but it is unexpected for sure.