neon/meta.rs
1//! Metadata about the Neon version and build.
2
3use semver::Version;
4
5/// The Neon version.
6pub const VERSION: &str = env!("CARGO_PKG_VERSION");
7
8/// The Neon major version.
9pub const MAJOR: &str = env!("CARGO_PKG_VERSION_MAJOR");
10
11/// The Neon minor version.
12pub const MINOR: &str = env!("CARGO_PKG_VERSION_MINOR");
13
14/// The Neon patch version.
15pub const PATCH: &str = env!("CARGO_PKG_VERSION_PATCH");
16
17/// Produces a `semver::Version` data structure representing the Neon version.
18pub fn version() -> Version {
19 Version {
20 major: MAJOR.parse().unwrap(),
21 minor: MINOR.parse().unwrap(),
22 patch: PATCH.parse().unwrap(),
23 pre: Default::default(),
24 build: Default::default(),
25 }
26}