Skip to content

Commit

Permalink
Merge pull request #16 from myelin-ai/metadata
Browse files Browse the repository at this point in the history
Update Metadata / Fix No Longer Blocked Issue
  • Loading branch information
bash authored May 31, 2024
2 parents 7f3be4e + ac985e9 commit 6ec5e9d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
5 changes: 3 additions & 2 deletions .mailmap
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Tau <[email protected]> <[email protected]>
Tau <[email protected]> <[email protected]>
Tau Gärtli <[email protected]> <[email protected]>
Tau Gärtli <[email protected]> <[email protected]>
Tau Gärtli <[email protected]>
Jan Hohenheim <[email protected]> <[email protected]>
Jan Hohenheim <[email protected]> <[email protected]>
13 changes: 9 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
[package]
name = "slablit"
description = "Literal for slab creation"
version = "0.3.0"
version = "0.3.1"
authors = [
"Tau <[email protected]>",
"Tau Gärtli <[email protected]>",
"Jeremy Stucki <[email protected]>",
]
license = "MIT/Apache-2.0"
license = "MIT OR Apache-2.0"
readme = "readme.md"
repository = "https://github.com/myelin-ai/slablit"
homepage = "https://github.com/myelin-ai/slablit"
documentation = "https://docs.rs/slablit"
edition = "2021"
exclude = [".github", ".mailmap", ".gitignore"]
categories = ["data-structures"]
keywords = ["literal", "slab", "macro"]

[badges.maintenance]
status = "passively-maintained"

[dependencies]
slab = "0.4"
8 changes: 7 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog
## 0.3.1
* Updated metadata.
* Simplified creation of empty slabs:
```diff
- let (slab, []): (slab::Slab<i32>, [usize; 0]) = slab![];
+ let (slab, []): (slab::Slab<i32>, _) = slab![];
```

## 0.3.0

- Nightly is no longer required
7 changes: 4 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ macro_rules! __internal_count_tts {
#[macro_export]
macro_rules! slab {
($( $x:expr ),* $(,)?) => {{
const COUNT: usize = $crate::__internal_count_tts!($($x)*);
#[allow(unused_mut)]
let mut temp_slab = slab::Slab::with_capacity($crate::__internal_count_tts!($($x)*));
let keys = [$(temp_slab.insert($x), )*];
let mut temp_slab = slab::Slab::with_capacity(COUNT);
let keys: [usize; COUNT] = [$(temp_slab.insert($x), )*];

(temp_slab, keys)
}};
Expand All @@ -62,7 +63,7 @@ mod test {

#[test]
fn slab_macro_can_create_empty_slab() {
let (slab, []): (slab::Slab<i32>, [usize; 0]) = slab![];
let (slab, []): (slab::Slab<i32>, _) = slab![];
assert!(slab.is_empty());
}

Expand Down

0 comments on commit 6ec5e9d

Please sign in to comment.