jonas-schievink / pkg-version

Macros for accessing the Cargo package version at compile time
BSD Zero Clause License
8 stars 1 forks source link

Add a `pkg_version!` macro that expands to a `semver::Version` #1

Open jonas-schievink opened 5 years ago

jonas-schievink commented 5 years ago

semver::Version has public fields, so it can be constructed in a constant expression, provided that we can also construct a Vec. The latter is not yet possible on stable Rust, and is tracked in https://github.com/rust-lang/rust/issues/64022.

jonas-schievink commented 4 years ago

rust-lang/rust#64022 is now stable.

On second thought, I don't think I want to make semver part of this crate's public API, at least not until semver is at 1.0. We could also add macros for getting access to only the build metadata and pre-release identifiers as &'static strs.