Skip to content

Commit

Permalink
correct the correction in the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
droundy committed Jul 23, 2021
1 parent 57eb44a commit 0691787
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tinyset"
version = "0.4.5"
version = "0.4.6"
authors = ["David Roundy <[email protected]>"]

description = "Size-optimized sets"
Expand Down
8 changes: 5 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@
//!
//! All of these set types will do no heap allocation for small sets of
//! small elements. Small sets occupy the same space as a single
//! pointer, typically 64 bits. In these 64 bits, you can store up to
//! 61 elements if the elements are sufficiently small (29 elements on
//! 32-bit architectures). For larger numbers, you can store progressively
//! pointer, typically 64 bits. In these 64 bits (or 32 bits), you can
//! store up to
//! seven elements if the elements are sufficiently small and not too
//! widely spaced. For larger numbers and more widely spaced numbers,
//! you can store progressively
//! fewer elements without doing a heap allocation. When it does require
//! a heap allocation, tinyset is still far more compact than a `HashSet`,
//! particularly when the elements themselves are small.
Expand Down
7 changes: 7 additions & 0 deletions src/setu64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1578,6 +1578,13 @@ mod tests {
collect_size_is(&[255,260,265,270,275,280,285], 8);
collect_size_is(&[1000,1002,1004,1006,1008,1009,1010], 8);

incremental_size_le(& (0..7).collect::<Vec<_>>(), 8);
incremental_size_le(& (10..10+7).collect::<Vec<_>>(), 8);
incremental_size_le(& (100..100+7).collect::<Vec<_>>(), 8);
incremental_size_le(& (1000..1000+7).collect::<Vec<_>>(), 8);
incremental_size_le(& (10000..10000+7).collect::<Vec<_>>(), 8);
incremental_size_le(& (100000..100000+7).collect::<Vec<_>>(), 8);

incremental_size_le(& (1..30).collect::<Vec<_>>(), 40);
incremental_size_le(& (1..60).collect::<Vec<_>>(), 40);

Expand Down

0 comments on commit 0691787

Please sign in to comment.