From 5a5829d1df4d8460b3377c19330538b6cb134cf1 Mon Sep 17 00:00:00 2001 From: zephyr Date: Wed, 16 Oct 2024 20:53:26 +0900 Subject: [PATCH] make clippy happy --- Cargo.toml | 2 +- realm_core/src/dns/mod.rs | 2 ++ src/cmd/mod.rs | 10 ++-------- src/conf/mod.rs | 1 - 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0b2e38dd..98af0fb8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,7 +42,7 @@ fern = "0.6" chrono = "0.4" # command -clap = "4" +clap = { version = "4", features = ["string"] } toml = "0.8" serde = { version = "1", features = ["derive"] } serde_json = "1" diff --git a/realm_core/src/dns/mod.rs b/realm_core/src/dns/mod.rs index ed77a124..bc61429b 100644 --- a/realm_core/src/dns/mod.rs +++ b/realm_core/src/dns/mod.rs @@ -1,3 +1,5 @@ +#![allow(static_mut_refs)] + //! Global dns resolver. use std::io::{Result, Error, ErrorKind}; diff --git a/src/cmd/mod.rs b/src/cmd/mod.rs index 8d89a83e..67fcf3cd 100644 --- a/src/cmd/mod.rs +++ b/src/cmd/mod.rs @@ -21,16 +21,10 @@ pub enum CmdInput { } pub fn scan() -> CmdInput { - static mut _VER: String = String::new(); // damn! - let version = format!("{} {}", VERSION, FEATURES); - let version = unsafe { - _VER = version; - _VER.as_str() - }; - + let ver = format!("{} {}", VERSION, FEATURES); let app = Command::new("Realm") .about("A high efficiency relay tool") - .version(version); + .version(ver); let app = app .disable_help_flag(true) diff --git a/src/conf/mod.rs b/src/conf/mod.rs index 3348941c..8a1268fe 100644 --- a/src/conf/mod.rs +++ b/src/conf/mod.rs @@ -27,7 +27,6 @@ pub use legacy::LegacyConf; /// cmd | file => NetConf /// \ /// cmd | file => EndpointConf => { [local, remote, conn_opts] } - pub trait Config { type Output;