From f0208c759bc7e496b90d29af435cafa0e98c0599 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Sun, 18 Sep 2022 13:13:45 +0800 Subject: [PATCH] https://github.com/rustdesk/rustdesk/pull/1562 --- Cargo.lock | 23 ----------------------- build.rs | 1 + libs/hbb_common/Cargo.toml | 1 - libs/hbb_common/src/config.rs | 9 +++++++-- 4 files changed, 8 insertions(+), 26 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f2a260a9b..5627a861f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2302,7 +2302,6 @@ dependencies = [ "serde 1.0.144", "serde_derive", "serde_json 1.0.85", - "serde_with", "socket2 0.3.19", "sodiumoxide", "tokio", @@ -4588,28 +4587,6 @@ dependencies = [ "serde 1.0.144", ] -[[package]] -name = "serde_with" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678b5a069e50bf00ecd22d0cd8ddf7c236f68581b03db652061ed5eb13a312ff" -dependencies = [ - "serde 1.0.144", - "serde_with_macros", -] - -[[package]] -name = "serde_with_macros" -version = "1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "serde_yaml" version = "0.8.26" diff --git a/build.rs b/build.rs index c47ef2b1c..67e40752c 100644 --- a/build.rs +++ b/build.rs @@ -76,6 +76,7 @@ fn install_oboe() { //cc::Build::new().file("oboe.cc").include(include).compile("oboe_wrapper"); } +#[cfg(feature = "flutter")] fn gen_flutter_rust_bridge() { let llvm_path = match std::env::var("LLVM_HOME") { Ok(path) => Some(vec![path]), diff --git a/libs/hbb_common/Cargo.toml b/libs/hbb_common/Cargo.toml index 6773c0f53..8d4f36b2d 100644 --- a/libs/hbb_common/Cargo.toml +++ b/libs/hbb_common/Cargo.toml @@ -23,7 +23,6 @@ directories-next = "2.0" rand = "0.8" serde_derive = "1.0" serde = "1.0" -serde_with = "1.14.0" lazy_static = "1.4" confy = { git = "https://github.com/open-trade/confy" } dirs-next = "2.0" diff --git a/libs/hbb_common/src/config.rs b/libs/hbb_common/src/config.rs index 5fc974462..2ad8bee47 100644 --- a/libs/hbb_common/src/config.rs +++ b/libs/hbb_common/src/config.rs @@ -956,13 +956,18 @@ impl LocalConfig { #[derive(Debug, Default, Serialize, Deserialize, Clone)] pub struct DiscoveryPeer { + #[serde(default)] pub id: String, - #[serde(with = "serde_with::rust::map_as_tuple_list")] - pub ip_mac: HashMap, + #[serde(default)] pub username: String, + #[serde(default)] pub hostname: String, + #[serde(default)] pub platform: String, + #[serde(default)] pub online: bool, + #[serde(default)] + pub ip_mac: HashMap, } impl DiscoveryPeer {