From dd20821ddc582b958be007eb3d0972698b0a9c65 Mon Sep 17 00:00:00 2001 From: Philipp Matthias Schaefer Date: Thu, 25 Feb 2021 10:34:39 +0100 Subject: [PATCH] refactor(main): use clap::crate_version instead of constant --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 9586a4b..4a9d555 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,6 +3,7 @@ extern crate clap; extern crate handlebars; extern crate ldap3; +#[macro_use] extern crate clap; #[macro_use] extern crate rocket; extern crate rocket_contrib; #[macro_use] extern crate serde_derive; @@ -19,12 +20,11 @@ use rocket::config::{Config, Environment}; use crate::config::load_config; use crate::exit::exit_with_error; -const VERSION: &str = "1.0"; const DEFAULT_CONFIG_FILE_PATH: &str = "/etc/webldappasswd/config.json"; fn main() { let matches = App::new("WebLDAPPasswd") - .version(VERSION) + .version(crate_version!()) .arg(Arg::with_name("config") .short("c") .long("config")