pkg-version-impl-0.1.1/Cargo.toml.orig010064400017500001750000000007141354614536700160440ustar0000000000000000[package] name = "pkg-version-impl" version = "0.1.1" authors = ["Jonas Schievink "] edition = "2018" description = """ Implementation details of the `pkg-version` crate. Do not use this crate, it does not provide a stable API. """ documentation = "https://docs.rs/pkg-version-impl/" repository = "https://github.com/jonas-schievink/pkg-version.git" license = "0BSD" [lib] proc-macro = true [dependencies] proc-macro-hack = "0.5.5" pkg-version-impl-0.1.1/Cargo.toml0000644000000017350000000000000123010ustar00# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies # # If you believe there's an error in this file please file an # issue against the rust-lang/cargo repository. If you're # editing this file be aware that the upstream Cargo.toml # will likely look very different (and much more reasonable) [package] edition = "2018" name = "pkg-version-impl" version = "0.1.1" authors = ["Jonas Schievink "] description = "Implementation details of the `pkg-version` crate. Do not use this crate, it\ndoes not provide a stable API.\n" documentation = "https://docs.rs/pkg-version-impl/" license = "0BSD" repository = "https://github.com/jonas-schievink/pkg-version.git" [lib] proc-macro = true [dependencies.proc-macro-hack] version = "0.5.5" pkg-version-impl-0.1.1/src/lib.rs010064400017500001750000000033161354614357000150530ustar0000000000000000//! 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. //! //! [`pkg-version`]: https://docs.rs/pkg-version #![doc(html_root_url = "https://docs.rs/pkg-version-impl/0.0.0")] #![warn(missing_debug_implementations, rust_2018_idioms)] extern crate proc_macro; use proc_macro::TokenStream; use proc_macro_hack::proc_macro_hack; use std::env; /// A type large enough to hold a version component. /// /// This should match what the `semver` crate uses. type VersionNum = u64; #[proc_macro_hack] pub fn pkg_version_major(input: TokenStream) -> TokenStream { if !input.is_empty() { panic!("unexpected arguments for `pkg_version_major!` macro (expected no arguments)"); } let version = env::var("CARGO_PKG_VERSION_MAJOR") .unwrap() .parse::() .unwrap(); version.to_string().parse().unwrap() } #[proc_macro_hack] pub fn pkg_version_minor(input: TokenStream) -> TokenStream { if !input.is_empty() { panic!("unexpected arguments for `pkg_version_minor!` macro (expected no arguments)"); } let version = env::var("CARGO_PKG_VERSION_MINOR") .unwrap() .parse::() .unwrap(); version.to_string().parse().unwrap() } #[proc_macro_hack] pub fn pkg_version_patch(input: TokenStream) -> TokenStream { if !input.is_empty() { panic!("unexpected arguments for `pkg_version_patch!` macro (expected no arguments)"); } let version = env::var("CARGO_PKG_VERSION_PATCH") .unwrap() .parse::() .unwrap(); version.to_string().parse().unwrap() } pkg-version-impl-0.1.1/.cargo_vcs_info.json0000644000000001120000000000000142670ustar00{ "git": { "sha1": "bfb4cd8caf944084c87ffb5799dc2656cc173bce" } }