1 unstable release
| 0.1.0 | Jul 10, 2024 |
|---|
#17 in #version-semver
73 downloads per month
5KB
A proc-macro for semver::Version
This crate contains macros to parse semver::Versions at compile-time.
Currently only versions without pre-release and build metadata identifier
are supported.
Example
use semver::Version;
use semver_macro::{version, env_version};
// parse from string literal
const FROM_LITERAL: Version = version!("0.1.0");
// parse from environment variable
const FROM_ENV: Version = env_version!("CARGO_PKG_VERSION");
semver-macro
This crate contains macros to parse semver::Versions at compile-time.
Currently only versions without pre-release and build metadata identifier
are supported.
Example
use semver::Version;
use semver_macro::version;
const MY_VERSION: Version = version!("0.1.0");
Dependencies
~295–740KB
~16K SLoC