From 3744b8d130788f8b56d8eb6763586e89eb9a0647 Mon Sep 17 00:00:00 2001 From: Hristo Venev Date: Tue, 4 Feb 2020 23:31:18 +0100 Subject: Drop unused impls. --- src/config.rs | 43 ++++++------------------------------------- src/model.rs | 3 --- 2 files changed, 6 insertions(+), 40 deletions(-) diff --git a/src/config.rs b/src/config.rs index bbe6366..3eb0dd4 100644 --- a/src/config.rs +++ b/src/config.rs @@ -7,7 +7,7 @@ use serde_derive; use std::collections::HashMap; use std::path::PathBuf; -#[derive(serde_derive::Serialize, serde_derive::Deserialize, Clone, PartialEq, Eq, Debug)] +#[derive(serde_derive::Deserialize)] #[serde(deny_unknown_fields)] pub struct Source { pub name: String, @@ -19,7 +19,7 @@ pub struct Source { pub required: bool, } -#[derive(serde_derive::Serialize, serde_derive::Deserialize, Clone, PartialEq, Eq, Debug)] +#[derive(serde_derive::Deserialize)] #[serde(deny_unknown_fields)] pub struct Peer { pub source: Option, @@ -28,7 +28,6 @@ pub struct Peer { pub keepalive: Option, } -#[derive(Clone, PartialEq, Eq, Debug)] pub struct GlobalConfig { pub min_keepalive: u32, pub max_keepalive: u32, @@ -58,7 +57,6 @@ impl GlobalConfig { } } -#[derive(Clone, PartialEq, Eq, Debug)] pub struct UpdaterConfig { pub cache_directory: Option, @@ -76,8 +74,9 @@ impl Default for UpdaterConfig { } } -#[derive(serde_derive::Serialize, serde_derive::Deserialize, Default, Clone, Debug)] -#[serde(from = "ConfigRepr", into = "ConfigRepr")] +#[derive(serde_derive::Deserialize)] +#[serde(from = "ConfigRepr")] +#[derive(Default)] pub struct Config { pub runtime_directory: Option, pub global: GlobalConfig, @@ -85,7 +84,7 @@ pub struct Config { pub sources: Vec, } -#[derive(serde_derive::Serialize, serde_derive::Deserialize)] +#[derive(serde_derive::Deserialize)] #[serde(deny_unknown_fields)] struct ConfigRepr { runtime_directory: Option, @@ -105,36 +104,6 @@ struct ConfigRepr { sources: Vec, } -impl From for ConfigRepr { - #[inline] - fn from(v: Config) -> Self { - let Config { - runtime_directory, - global, - updater, - sources, - } = v; - let GlobalConfig { - min_keepalive, - max_keepalive, - peers, - } = global; - let UpdaterConfig { - cache_directory, - refresh_sec, - } = updater; - Self { - runtime_directory, - cache_directory, - min_keepalive, - max_keepalive, - peers, - refresh_sec, - sources, - } - } -} - impl From for Config { #[inline] fn from(v: ConfigRepr) -> Self { diff --git a/src/model.rs b/src/model.rs index 1f537bc..5797f0e 100644 --- a/src/model.rs +++ b/src/model.rs @@ -2,9 +2,6 @@ // // Copyright 2019 Hristo Venev -// FIXME: arrayref needs to silence this per-expression -#![allow(clippy::eval_order_dependence)] - use base64; use std::collections::HashMap; use std::fmt; -- cgit