From fd76bff015a3f6de977e9294bfdd7bb33e1b9e32 Mon Sep 17 00:00:00 2001 From: narodnik Date: Sat, 12 Feb 2022 10:10:22 +0100 Subject: [PATCH] fix breaking changes: * Cloneable property was removed from Error * get_info() doesn't exist * The clap for the logger was overriding the main arg parser for the app itself. --- bin/ircd/src/main.rs | 18 ++++++++++++------ src/error.rs | 2 +- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/bin/ircd/src/main.rs b/bin/ircd/src/main.rs index 81ff04903..bc9f82fb2 100644 --- a/bin/ircd/src/main.rs +++ b/bin/ircd/src/main.rs @@ -205,7 +205,7 @@ impl RequestHandler for JsonRpcInterface { match req.method.as_str() { Some("say_hello") => return self.say_hello(req.id, req.params).await, - Some("get_info") => return self.get_info(req.id, req.params).await, + //Some("get_info") => return self.get_info(req.id, req.params).await, Some(_) | None => return JsonResult::Err(jsonerr(MethodNotFound, None, req.id)), } } @@ -220,13 +220,19 @@ impl JsonRpcInterface { } fn main() -> Result<()> { - let matches = CliIrcd::into_app().get_matches(); - let conf: simplelog::Config; - let lvl: LevelFilter; + //let matches = CliIrcd::into_app().get_matches(); + //let conf: simplelog::Config; + //let lvl: LevelFilter; - (lvl, conf) = log_config(matches)?; + //let (lvl, conf) = log_config(matches)?; - TermLogger::init(lvl, conf, TerminalMode::Mixed, ColorChoice::Auto)?; + //TermLogger::init(lvl, conf, TerminalMode::Mixed, ColorChoice::Auto)?; + TermLogger::init( + LevelFilter::Debug, + simplelog::Config::default(), + TerminalMode::Mixed, + ColorChoice::Auto, + )?; let options = ProgramOptions::load()?; diff --git a/src/error.rs b/src/error.rs index 1e6bf2f0a..52f3f1853 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,6 +1,6 @@ pub type Result = std::result::Result; -#[derive(Debug, thiserror::Error)] +#[derive(Debug, Clone, thiserror::Error)] pub enum Error { #[error("io error: `{0:?}`")] Io(std::io::ErrorKind),