#version #package-version #details #stable #api #macro #pkg-version

macro pkg-version-impl

Implementation details of the pkg-version crate. Do not use this crate, it does not provide a stable API.

2 releases

0.1.1 Oct 5, 2019
0.1.0 May 3, 2019

#19 in #package-version

Download history 905/week @ 2024-01-03 823/week @ 2024-01-10 699/week @ 2024-01-17 564/week @ 2024-01-24 1155/week @ 2024-01-31 990/week @ 2024-02-07 1180/week @ 2024-02-14 1126/week @ 2024-02-21 1155/week @ 2024-02-28 1010/week @ 2024-03-06 942/week @ 2024-03-13 1084/week @ 2024-03-20 1959/week @ 2024-03-27 1441/week @ 2024-04-03 1217/week @ 2024-04-10 913/week @ 2024-04-17

5,772 downloads per month
Used in 24 crates (via pkg-version)

0BSD license

4KB

pkg-version - Macros for accessing your crate version

crates.io docs.rs CI

This crate provides macros (pkg_version_major!, etc.) that expand to the Cargo package version, as an integer literal.

Previously, the only way to access the package version was by using env!("CARGO_PKG_VERSION_MAJOR") etc., but doing that always results in a string literal, which can only be parsed into a number at runtime. This crate fixes that problem by parsing the version during macro expansion.

Please refer to the changelog to see what changed in the last releases.

Usage

Add an entry to your Cargo.toml:

[dependencies]
pkg-version = "1.0.0"

Check the API Documentation for how to use the crate's functionality.


lib.rs:

Implementation details of the pkg-version crate.

Do not use this crate directly. It does not provide a stable API and might break at any time. Use pkg-version instead.

Dependencies

~4KB