#cargo-version #job #building

build version

A very simple library who's job is to return the version of your crate if you're building with Cargo

5 stable releases

Uses old Rust 2015

3.0.0 Mar 28, 2018
2.0.1 Jan 25, 2016
1.1.0 Jan 13, 2016
1.0.0 Jan 8, 2015

#302 in Build Utils

Download history 1087/week @ 2024-07-27 850/week @ 2024-08-03 810/week @ 2024-08-10 753/week @ 2024-08-17 843/week @ 2024-08-24 976/week @ 2024-08-31 933/week @ 2024-09-07 955/week @ 2024-09-14 1067/week @ 2024-09-21 1055/week @ 2024-09-28 968/week @ 2024-10-05 793/week @ 2024-10-12 1360/week @ 2024-10-19 1150/week @ 2024-10-26 1043/week @ 2024-11-02 616/week @ 2024-11-09

4,316 downloads per month
Used in 54 crates (35 directly)

MIT/Apache

7KB
58 lines

version

version is a very simple library who's job is to return the version of your crate if you're building with Cargo.

Usage:

#[macro_use]
extern crate version;

// ...

version!() // Returns something like "1.0.0"

let ver : Version = FromStr::from_str( version!() ).unwrap();

Notes:

This only works if you're building with Cargo since the macro fetches the version digits from enviroment variables set by Cargo ( CARGO_PKG_VERSION_{MAJOR, MINOR, PATCH} ).

No runtime deps