Skip to main content

nik_rev/
lib.rs

1#[macro_export]
2macro_rules! badges {
3    ($repo_name:literal) => {
4        concat!(
5            "[![crates.io](https://img.shields.io/crates/v/", env!("CARGO_PKG_NAME"), "?style=flat-square&logo=rust)](https://crates.io/crates/", env!("CARGO_PKG_NAME"), ")\n",
6            "[![docs.rs](https://img.shields.io/badge/docs.rs-", env!("CARGO_PKG_NAME"), "-blue?style=flat-square&logo=docs.rs)](https://docs.rs/", env!("CARGO_PKG_NAME"), ")\n",
7            "![license](https://img.shields.io/badge/license-Apache--2.0_OR_MIT-blue?style=flat-square)\n",
8            "![msrv](https://img.shields.io/badge/msrv-", env!("CARGO_PKG_RUST_VERSION"), "-blue?style=flat-square&logo=rust)\n",
9            "[![github](https://img.shields.io/github/stars/nik-rev/", $repo_name, ")](https://github.com/nik-rev/", $repo_name, ")"
10        )
11    };
12}
13
14#[macro_export]
15#[rustfmt::skip]
16macro_rules! add_dependency {
17    () => {
18        concat!(
19            "```toml\n",
20            "[dependencies]\n",
21            env!("CARGO_CRATE_NAME"), " = \"",  env!("CARGO_PKG_VERSION_MAJOR"), ".", env!("CARGO_PKG_VERSION_MINOR"), "\"\n",
22            "```\n",
23        )
24    };
25}