updated hotreload branch
This commit is contained in:
parent
8dcdc017e0
commit
8c9575b6bd
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -1232,7 +1232,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "zabbixlaunch"
|
||||
version = "0.1.0"
|
||||
version = "1.0.0"
|
||||
dependencies = [
|
||||
"clap",
|
||||
"embedded-graphics",
|
||||
|
@ -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
|
||||
|
@ -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 <paul@paulbsd.com>")
|
||||
.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<Config, Error> = serde_json::from_str(contents.as_str());
|
||||
let parse: Result<Config, JsonError> = 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() {
|
||||
|
Loading…
Reference in New Issue
Block a user