Bläddra i källkod

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.
narodnik 4 år sedan
förälder
incheckning
fd76bff015
2 ändrade filer med 15 tillägg och 9 borttagningar
  1. 14 8
      bin/ircd/src/main.rs
  2. 1 1
      src/error.rs

+ 14 - 8
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;
-
-    (lvl, conf) = log_config(matches)?;
-
-    TermLogger::init(lvl, conf, TerminalMode::Mixed, ColorChoice::Auto)?;
+    //let matches = CliIrcd::into_app().get_matches();
+    //let conf: simplelog::Config;
+    //let lvl: LevelFilter;
+
+    //let (lvl, conf) = log_config(matches)?;
+
+    //TermLogger::init(lvl, conf, TerminalMode::Mixed, ColorChoice::Auto)?;
+    TermLogger::init(
+        LevelFilter::Debug,
+        simplelog::Config::default(),
+        TerminalMode::Mixed,
+        ColorChoice::Auto,
+    )?;
 
     let options = ProgramOptions::load()?;
 

+ 1 - 1
src/error.rs

@@ -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),