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.
This commit is contained in:
narodnik
2022-02-12 10:10:22 +01:00
parent 4eee40e873
commit fd76bff015
2 changed files with 13 additions and 7 deletions

View File

@@ -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()?;

View File

@@ -1,6 +1,6 @@
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Debug, thiserror::Error)]
#[derive(Debug, Clone, thiserror::Error)]
pub enum Error {
#[error("io error: `{0:?}`")]
Io(std::io::ErrorKind),