From e69b5a76db828400e78e03e206589069ab88d424 Mon Sep 17 00:00:00 2001 From: Vladislav Mamon Date: Tue, 27 Feb 2024 03:01:43 +0300 Subject: [PATCH] refactor: remove useless `serde` derives --- Cargo.toml | 2 +- src/coord.rs | 3 +-- src/relays.rs | 5 ++--- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2fd521f..e5967bb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ anyhow = "1.0.80" clap = { version = "4.5.1", features = ["derive"] } indicatif = "0.17.8" reqwest = { version = "0.11.24", features = ["json"] } -serde = { version = "1.0.197", features = ["derive"] } +serde = "1.0.197" serde_json = "1.0.114" tabled = "0.15.0" thiserror = "1.0.57" diff --git a/src/coord.rs b/src/coord.rs index 3012ef5..b2f3265 100644 --- a/src/coord.rs +++ b/src/coord.rs @@ -1,4 +1,3 @@ -use serde::{Deserialize, Serialize}; use serde_json::Value; use thiserror::Error; @@ -13,7 +12,7 @@ pub enum CoordError { } /// Represents a point on Earth. -#[derive(Clone, Copy, Debug, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug)] pub struct Coord { latitude: f64, longitude: f64, diff --git a/src/relays.rs b/src/relays.rs index 800f07a..edb8e70 100644 --- a/src/relays.rs +++ b/src/relays.rs @@ -3,7 +3,6 @@ use std::fmt::{self, Debug, Display}; use std::fs; use std::path::PathBuf; -use serde::{Deserialize, Serialize}; use serde_json::Value; use thiserror::Error; @@ -25,7 +24,7 @@ pub enum RelaysError { UnsupportedSystem(String), } -#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq)] +#[derive(Clone, Copy, Debug, PartialEq)] pub enum Protocol { OpenVPN, WireGuard, @@ -40,7 +39,7 @@ impl Display for Protocol { } } -#[derive(Clone, Debug, Serialize, Deserialize)] +#[derive(Clone, Debug)] pub struct Relay { pub ip: String, pub city: String,