From 027eb64ddc406c6d260e9b3ce1ac52fe7245766e Mon Sep 17 00:00:00 2001 From: Valerie Date: Mon, 27 Jun 2022 21:48:09 -0400 Subject: [PATCH] handle version printing correctly --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/main.rs | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fa98656..ba4edcd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13,7 +13,7 @@ dependencies = [ [[package]] name = "config" -version = "0.1.0" +version = "0.1.1" dependencies = [ "regex", "toml", diff --git a/Cargo.toml b/Cargo.toml index 9549bd1..4229412 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "config" -version = "0.1.1" +version = "0.1.2" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/main.rs b/src/main.rs index 063322c..5b4b28d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,8 +16,6 @@ use toml::Value; mod error; -pub const VERSION: &str = "0.1.1"; - fn main() -> Result<(), Box>{ let home_dir = var("HOME").unwrap(); let mut config_path = PathBuf::from(&home_dir); @@ -161,7 +159,7 @@ fn main() -> Result<(), Box>{ } fn help_text() { - println!("config v{}", VERSION); + println!("config v{}", env!("CARGO_PKG_VERSION")); println!("Valerie Wolfe "); println!("A configuration manager written in Rust.\n"); println!("USAGE:");