constant macro arrays
deprecate car
| -rw-r--r-- | Cargo.toml | 10 | ||||
| -rw-r--r-- | LICENSE | 2 | ||||
| -rw-r--r-- | README.md | 11 | ||||
| -rw-r--r-- | src/lib.rs | 2 |
4 files changed, 20 insertions, 5 deletions
@@ -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 @@ -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 @@ -1,5 +1,7 @@ # `car` + + 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. @@ -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! { { |