#cargo-version #building #who #return #you-re #macro

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

#4 in #you-re

Download history 2149/week @ 2024-12-02 8303/week @ 2024-12-09 1188/week @ 2024-12-16 751/week @ 2024-12-23 658/week @ 2024-12-30 981/week @ 2025-01-06 1092/week @ 2025-01-13 1050/week @ 2025-01-20 866/week @ 2025-01-27 1017/week @ 2025-02-03 1286/week @ 2025-02-10 1151/week @ 2025-02-17 1406/week @ 2025-02-24 1346/week @ 2025-03-03 1418/week @ 2025-03-10 931/week @ 2025-03-17

5,184 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