From 8c9575b6bdb110c4173cd543280559dc19dc00b8 Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Tue, 19 Oct 2021 13:57:07 +0200 Subject: [PATCH] updated hotreload branch --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/config/mod.rs | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e6b7972..2ad02ac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1232,7 +1232,7 @@ dependencies = [ [[package]] name = "zabbixlaunch" -version = "0.1.0" +version = "1.0.0" dependencies = [ "clap", "embedded-graphics", diff --git a/Cargo.toml b/Cargo.toml index 2ef61e4..7b73f8a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zabbixlaunch" -version = "0.1.0" +version = "1.0.0" edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/config/mod.rs b/src/config/mod.rs index 8c411ff..a2aca33 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -1,7 +1,7 @@ use clap::{App, Arg, ArgMatches}; use nix::sys::inotify::{AddWatchFlags, InitFlags, Inotify}; use serde::{Deserialize, Serialize}; -use serde_json::Error; +use serde_json::Error as JsonError; use std::string::String; use std::thread::sleep; use std::time::Duration; @@ -51,7 +51,7 @@ impl Context { } pub fn argparse() -> ArgMatches<'static> { App::new("Zabbix Launch") - .version("1.0") + .version("1.0.0") .author("PaulBSD ") .about("Lights up Launchpad mini using Zabbix data") .arg( @@ -116,7 +116,7 @@ impl<'a> Config { let filemeta = std::fs::metadata(configfile); let fileexists = match filemeta { Ok(_) => true, - Err(_err) => false, + Err(_) => false, }; if !fileexists { @@ -132,10 +132,10 @@ impl<'a> Config { }; let mut contents = String::new(); file.read_to_string(&mut contents).unwrap(); - let parse: Result = serde_json::from_str(contents.as_str()); + let parse: Result = serde_json::from_str(contents.as_str()); let cfg = match parse { Ok(cfg) => cfg, - Err(_e) => Config::new(), + Err(_) => Config::new(), }; *self = cfg; if self.feed_missing() {