Skip to content

Commit

Permalink
Add a default length of 64 to SparseChunk.
Browse files Browse the repository at this point in the history
  • Loading branch information
bodil committed Apr 12, 2019
1 parent e6cf5dc commit 21660d7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Versioning](http://semver.org/spec/v2.0.0.html).

### ADDED

- `SparseChunk` now has a default length of `U64`.
- `Chunk` now has `PartialEq` defined for anything that can be borrowed as a
slice.
- `Chunk` has a new method `capacity()` which returns its maximum capacity (the
Expand Down
4 changes: 3 additions & 1 deletion src/sparse_chunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ use std::ops::IndexMut;
use std::ptr;
use std::slice::{from_raw_parts, from_raw_parts_mut};

use typenum::U64;

use crate::bitmap::{Bitmap, Iter as BitmapIter};
use crate::types::{Bits, ChunkLength};

Expand Down Expand Up @@ -52,7 +54,7 @@ use crate::types::{Bits, ChunkLength};
/// ```
///
/// [Unsigned]: https://docs.rs/typenum/1.10.0/typenum/marker_traits/trait.Unsigned.html
pub struct SparseChunk<A, N: Bits + ChunkLength<A>> {
pub struct SparseChunk<A, N: Bits + ChunkLength<A> = U64> {
map: Bitmap<N>,
data: ManuallyDrop<N::SizedType>,
}
Expand Down

0 comments on commit 21660d7

Please sign in to comment.