From 3a3bbe3e369fa7ef81899dd347e220f513e9117b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tau=20G=C3=A4rtli?= Date: Thu, 30 May 2024 15:58:42 +0200 Subject: [PATCH 1/8] Use full name --- .mailmap | 5 +++-- Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.mailmap b/.mailmap index 12cc396..58bfd4a 100644 --- a/.mailmap +++ b/.mailmap @@ -1,4 +1,5 @@ -Tau -Tau +Tau Gärtli +Tau Gärtli +Tau Gärtli Jan Hohenheim Jan Hohenheim diff --git a/Cargo.toml b/Cargo.toml index 3c5dd12..4e21631 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "slablit" description = "Literal for slab creation" version = "0.3.0" authors = [ - "Tau ", + "Tau Gärtli ", "Jeremy Stucki ", ] license = "MIT/Apache-2.0" From 526cb1604d300ddaaa5a530ff5fa13eb8486beb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tau=20G=C3=A4rtli?= Date: Thu, 30 May 2024 15:59:36 +0200 Subject: [PATCH 2/8] Mark as passively maintained --- Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 4e21631..e6a6dec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,5 +13,8 @@ homepage = "https://github.com/myelin-ai/slablit" documentation = "https://docs.rs/slablit" edition = "2021" +[badges.maintenance] +status = "passively-maintained" + [dependencies] slab = "0.4" From 9d36341087c791f7c777f472b71fcf7c2ef9527e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tau=20G=C3=A4rtli?= Date: Thu, 30 May 2024 16:00:02 +0200 Subject: [PATCH 3/8] Exclude not needed files --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index e6a6dec..be3e461 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,6 +12,7 @@ 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"] [badges.maintenance] status = "passively-maintained" From 734a437ac415fad1f02c29ea26ffd41af1b4fff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tau=20G=C3=A4rtli?= Date: Thu, 30 May 2024 16:01:20 +0200 Subject: [PATCH 4/8] Remove homepage --- Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index be3e461..594aa99 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,6 @@ authors = [ license = "MIT/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"] From 517298a4166e546c24e5d4642c92fb27f7bdb119 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tau=20G=C3=A4rtli?= Date: Thu, 30 May 2024 16:01:39 +0200 Subject: [PATCH 5/8] Use correct syntax for license expr --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 594aa99..8243d9e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ authors = [ "Tau Gärtli ", "Jeremy Stucki ", ] -license = "MIT/Apache-2.0" +license = "MIT OR Apache-2.0" readme = "readme.md" repository = "https://github.com/myelin-ai/slablit" documentation = "https://docs.rs/slablit" From b37f276a4bec57fd65acdb087249702e1467139b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tau=20G=C3=A4rtli?= Date: Thu, 30 May 2024 16:03:01 +0200 Subject: [PATCH 6/8] Add categories and keywords --- Cargo.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 8243d9e..b92906f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,6 +12,8 @@ repository = "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" From 32794f0cbea06b3d150cb13026026a8c17bbafd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tau=20G=C3=A4rtli?= Date: Thu, 30 May 2024 16:09:22 +0200 Subject: [PATCH 7/8] Annotate slice type Resolves #10 --- src/lib.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 1f0e991..2e441b9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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) }}; @@ -62,7 +63,7 @@ mod test { #[test] fn slab_macro_can_create_empty_slab() { - let (slab, []): (slab::Slab, [usize; 0]) = slab![]; + let (slab, []): (slab::Slab, _) = slab![]; assert!(slab.is_empty()); } From ac985e9c2197f10b1bba83fc9f2e97017e41d51b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tau=20G=C3=A4rtli?= Date: Thu, 30 May 2024 16:11:48 +0200 Subject: [PATCH 8/8] Bump version, update changelog --- Cargo.toml | 2 +- changelog.md | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b92906f..48e9e96 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "slablit" description = "Literal for slab creation" -version = "0.3.0" +version = "0.3.1" authors = [ "Tau Gärtli ", "Jeremy Stucki ", diff --git a/changelog.md b/changelog.md index 83e7cdf..021c934 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # Changelog +## 0.3.1 +* Updated metadata. +* Simplified creation of empty slabs: + ```diff + - let (slab, []): (slab::Slab, [usize; 0]) = slab![]; + + let (slab, []): (slab::Slab, _) = slab![]; + ``` ## 0.3.0 - - Nightly is no longer required