constant macro arrays
deprecate car
bendn 4 weeks ago
parent e03074a · commit 24046fa
-rw-r--r--Cargo.toml10
-rw-r--r--LICENSE2
-rw-r--r--README.md11
-rw-r--r--src/lib.rs2
4 files changed, 20 insertions, 5 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 95c380e..bab90ba 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,12 +1,15 @@
[package]
name = "car"
-version = "0.1.3"
+version = "0.1.4"
authors = ["bend-n <[email protected]>"]
description = "std::array::{map, from_fn, try_from_fn} in const"
-edition = "2021"
+edition = "2024"
repository = "https://github.com/bend-n/car"
license = "MIT"
+[badges]
+maintenance = { status = "deprecated" }
+
[dependencies]
proc-macro2 = "1.0.79"
quote = "1.0.35"
@@ -14,3 +17,6 @@ syn = { version = "2.0.55", features = ["full"] }
[lib]
proc-macro = true
+
+[package.metadata.docs.rs]
+rustdoc-args = ["--generate-link-to-definition"] \ No newline at end of file
diff --git a/LICENSE b/LICENSE
index 2f002a4..8c33164 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2024 bendn
+Copyright (c) 2026 bendn
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/README.md b/README.md
index 35d66ce..d34c00a 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,7 @@
# `car`
+![forthebadge](https://forthebadge.com/api/badges/generate?panels=2&primaryLabel=+maintained&secondaryLabel=NO%21&primaryBGColor=%231b80a0&primaryTextColor=%23FFFFFF&secondaryBGColor=%23e70e0e&secondaryTextColor=%23FFFFFF&primaryFontSize=12&primaryFontWeight=900&primaryLetterSpacing=2&primaryFontFamily=Verdana&primaryTextTransform=uppercase&secondaryFontSize=12&secondaryFontWeight=900&secondaryLetterSpacing=2&secondaryFontFamily=Verdana&secondaryTextTransform=uppercase&scale=0.6)
+
macro based array manipulation constant techniques
## you wanted a quick LUT in const? here you go!
@@ -11,4 +13,11 @@ let squares: [usize; 0xffffffff] = car::from_fn!(|i| i * 2);
## completely stable!
-for once! \ No newline at end of file
+for once!
+
+## notice
+
+with the advent of const closures in nightly rust, this crate is now only useful if you're on stable.
+any nightly users should switch to using `x.map(const |x| ..)` or `from_fn(const |i| ..)` instead.
+
+as a result, this crate is now deprecated.
diff --git a/src/lib.rs b/src/lib.rs
index da6dc37..447a5ed 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -115,7 +115,7 @@ pub fn map(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
e => {
return Error::new(e.span(), format!("mismatched types: expected function"))
.into_compile_error()
- .into()
+ .into();
}
};
quote! { {