diff options
author | Hristo Venev <hristo@venev.name> | 2019-03-18 12:37:27 +0200 |
---|---|---|
committer | Hristo Venev <hristo@venev.name> | 2019-03-18 12:37:27 +0200 |
commit | 761a87cc6e64990b9dd0e235047e1d1e7c7d6971 (patch) | |
tree | 920eac8fe6cfc12890cac0f19c9a016ed2b7913b /src/proto.rs | |
parent | ac554b8129d2c43d87a5a0abca6bd097d870fe6d (diff) |
Lint
Diffstat (limited to 'src/proto.rs')
-rw-r--r-- | src/proto.rs | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/proto.rs b/src/proto.rs index e6759a1..a3ee6e6 100644 --- a/src/proto.rs +++ b/src/proto.rs @@ -1,11 +1,10 @@ -use ::std::time::SystemTime; -use ::serde_derive; +use serde_derive; +use std::time::SystemTime; -use crate::ip::{Ipv4Net, Ipv6Net, Endpoint}; +use crate::ip::{Endpoint, Ipv4Net, Ipv6Net}; #[serde(deny_unknown_fields)] -#[derive(serde_derive::Serialize, serde_derive::Deserialize)] -#[derive(Clone, PartialEq, Eq, Debug)] +#[derive(serde_derive::Serialize, serde_derive::Deserialize, Clone, PartialEq, Eq, Debug)] pub struct Peer { pub public_key: String, pub endpoint: Endpoint, @@ -19,14 +18,12 @@ fn default_peer_keepalive() -> u32 { 0 } -#[derive(serde_derive::Serialize, serde_derive::Deserialize)] -#[derive(Clone, PartialEq, Eq, Debug)] +#[derive(serde_derive::Serialize, serde_derive::Deserialize, Clone, PartialEq, Eq, Debug)] pub struct SourceConfig { pub peers: Vec<Peer>, } -#[derive(serde_derive::Serialize, serde_derive::Deserialize)] -#[derive(Clone, PartialEq, Eq, Debug)] +#[derive(serde_derive::Serialize, serde_derive::Deserialize, Clone, PartialEq, Eq, Debug)] pub struct SourceNextConfig { #[serde(with = "serde_utc")] pub update_at: SystemTime, @@ -34,8 +31,7 @@ pub struct SourceNextConfig { pub config: SourceConfig, } -#[derive(serde_derive::Serialize, serde_derive::Deserialize)] -#[derive(Clone, PartialEq, Eq, Debug)] +#[derive(serde_derive::Serialize, serde_derive::Deserialize, Clone, PartialEq, Eq, Debug)] pub struct Source { #[serde(flatten)] pub config: SourceConfig, @@ -43,10 +39,10 @@ pub struct Source { } mod serde_utc { - use ::std::time::SystemTime; - use ::chrono::{DateTime, TimeZone, Utc, SecondsFormat}; - use ::serde::*; use crate::bin; + use chrono::{DateTime, SecondsFormat, TimeZone, Utc}; + use serde::*; + use std::time::SystemTime; pub fn serialize<S: Serializer>(t: &SystemTime, ser: S) -> Result<S::Ok, S::Error> { let t = DateTime::<Utc>::from(*t); |