From 4c23e696a6bbf19f4f0806501af04aaf606ab3fa Mon Sep 17 00:00:00 2001
From: chenjiayi <chenjiayi22@huawei.com>
Date: Wed, 8 Nov 2023 14:28:35 +0800
Subject: [PATCH 050/103] fix(devmaster): drop unnecessary debug trait
 implementations

The debug trait derivations will break the compilation.
---
 .../src/lib/framework/control_manager.rs         |  1 -
 .../src/lib/framework/garbage_collect.rs         |  2 --
 .../src/lib/framework/worker_manager.rs          |  2 --
 libs/device/src/error.rs                         | 16 +++-------------
 4 files changed, 3 insertions(+), 18 deletions(-)

diff --git a/exts/devmaster/src/lib/framework/control_manager.rs b/exts/devmaster/src/lib/framework/control_manager.rs
index 75fae984..342c6a0c 100644
--- a/exts/devmaster/src/lib/framework/control_manager.rs
+++ b/exts/devmaster/src/lib/framework/control_manager.rs
@@ -30,7 +30,6 @@ use std::{
 pub const CONTROL_MANAGER_LISTEN_ADDR: &str = "/run/devmaster/control";
 
 /// control manager
-#[derive(Debug)]
 pub struct ControlManager {
     /// listener for devctl messages
     listener: RefCell<UnixListener>,
diff --git a/exts/devmaster/src/lib/framework/garbage_collect.rs b/exts/devmaster/src/lib/framework/garbage_collect.rs
index 7a12ede8..c154f430 100644
--- a/exts/devmaster/src/lib/framework/garbage_collect.rs
+++ b/exts/devmaster/src/lib/framework/garbage_collect.rs
@@ -25,7 +25,6 @@ use std::{
 /// max time interval for idle worker
 const WORKER_MAX_IDLE_INTERVAL: u64 = 3;
 
-#[derive(Debug)]
 pub(crate) struct GarbageCollect {
     devmaster: Weak<RefCell<Devmaster>>,
 
@@ -128,7 +127,6 @@ impl Source for GarbageCollect {
 }
 
 /// kill idle workers
-#[derive(Debug)]
 pub(crate) struct IdleWorkerKiller {
     /// time interval
     pub(crate) time: u64,
diff --git a/exts/devmaster/src/lib/framework/worker_manager.rs b/exts/devmaster/src/lib/framework/worker_manager.rs
index c7c1d45f..870f6779 100644
--- a/exts/devmaster/src/lib/framework/worker_manager.rs
+++ b/exts/devmaster/src/lib/framework/worker_manager.rs
@@ -47,7 +47,6 @@ pub(crate) enum WorkerMessage {
 }
 
 /// worker manager
-#[derive(Debug)]
 pub struct WorkerManager {
     /// max number of workers
     pub(crate) workers_capacity: u32,
@@ -65,7 +64,6 @@ pub struct WorkerManager {
 }
 
 /// worker
-#[derive(Debug)]
 pub struct Worker {
     /// worker unique id
     id: u32,
diff --git a/libs/device/src/error.rs b/libs/device/src/error.rs
index 10410301..2cea6f4b 100644
--- a/libs/device/src/error.rs
+++ b/libs/device/src/error.rs
@@ -19,22 +19,13 @@ use snafu::prelude::Snafu;
 #[derive(Debug, Snafu)]
 #[snafu(visibility(pub))]
 #[non_exhaustive]
+#[allow(missing_docs)]
 pub enum Error {
-    /// other error
     #[snafu(context, display("Device error: {}", msg))]
-    Nix {
-        /// message
-        msg: String,
-        /// errno indicates the error kind
-        source: nix::Error,
-    },
+    Nix { msg: String, source: nix::Error },
 
     #[snafu(context, display("IO error: {}", msg))]
-    Io {
-        /// message
-        msg: String,
-        source: std::io::Error,
-    },
+    Io { msg: String, source: std::io::Error },
 
     #[snafu(context, display("Basic error: {}", msg))]
     Basic { msg: String, source: basic::Error },
@@ -106,7 +97,6 @@ impl Error {
     }
 }
 
-
 #[cfg(test)]
 mod test {
     use super::*;
-- 
2.33.0

