#concat #const

no-std constcat

concat! with support for const variables and expressions

3 unstable releases

new 0.2.0 Sep 25, 2022
0.1.1 Mar 30, 2022
0.1.0 Mar 19, 2022

#495 in Rust patterns

Download history 160/week @ 2022-06-07 2/week @ 2022-06-14 54/week @ 2022-06-21 30/week @ 2022-06-28 59/week @ 2022-07-05 8/week @ 2022-07-12 15/week @ 2022-07-19 38/week @ 2022-07-26 17/week @ 2022-08-02 102/week @ 2022-08-09 151/week @ 2022-08-16 10/week @ 2022-08-23 45/week @ 2022-08-30 57/week @ 2022-09-06 63/week @ 2022-09-13 18/week @ 2022-09-20

183 downloads per month

MIT/Apache

8KB
94 lines

constcat

Crates.io Version Docs.rs Latest Build Status

std::concat! with support for const variables and expressions.

Works on stable Rust ✨.

🚀 Getting started

Add constcat to your Cargo manifest.

[dependencies]
constcat = "0.2.0"

Import the macro using the following.

use constcat::concat;

🤸 Usage

concat! works exactly like std::concat! except you can now pass variables and constant expressions.

use constcat::concat;

const CRATE_NAME: &str = env!("CARGO_PKG_NAME");
const CRATE_VERSION: &str = env!("CARGO_PKG_VERSION");
const fn tada() -> &'static str { "🎉" }
const VERSION: &str = concat!(CRATE_NAME, " ", CRATE_VERSION, tada());

License

Licensed under either of

at your option.

No runtime deps