Skip to content
This repository has been archived by the owner on Jun 25, 2021. It is now read-only.

Commit

Permalink
fix: no longer use serde macro derive
Browse files Browse the repository at this point in the history
  • Loading branch information
maqi authored and dirvine committed Oct 21, 2020
1 parent 121ce95 commit 2116420
Show file tree
Hide file tree
Showing 17 changed files with 16 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/consensus/dkg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use crate::{
use bls_dkg::key_gen::{outcome::Outcome, KeyGen};
use hex_fmt::HexFmt;
use itertools::Itertools;
use serde::{Deserialize, Serialize};
use std::{
collections::{HashMap, HashSet},
fmt::{self, Debug, Formatter},
Expand Down
2 changes: 1 addition & 1 deletion src/consensus/proven.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// permissions and limitations relating to use of the SAFE Network Software.

use crate::{consensus::Proof, section::SectionProofChain};
use serde::Serialize;
use serde::{Deserialize, Serialize};
use std::{borrow::Borrow, fmt::Debug};
use xor_name::Prefix;

Expand Down
2 changes: 1 addition & 1 deletion src/consensus/vote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::{
messages::PlainMessage,
section::{EldersInfo, MemberInfo, SectionProofChain},
};
use serde::{Serialize, Serializer};
use serde::{Deserialize, Serialize, Serializer};
use xor_name::{Prefix, XorName};

#[derive(Clone, Eq, PartialEq, Debug, Serialize, Deserialize)]
Expand Down
2 changes: 0 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@

#[macro_use]
extern crate log;
#[macro_use]
extern crate serde;

// ############################################################################
// Public API
Expand Down
1 change: 1 addition & 0 deletions src/location.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// permissions and limitations relating to use of the SAFE Network Software.

use crate::error::{Error, Result};
use serde::{Deserialize, Serialize};
use xor_name::{Prefix, XorName};

/// Message source location.
Expand Down
1 change: 1 addition & 0 deletions src/messages/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

use crate::crypto::{self, Digest256};
use hex_fmt::HexFmt;
use serde::{Deserialize, Serialize};
use std::fmt::{self, Debug, Formatter};

/// Cryptographic hash of Message
Expand Down
1 change: 1 addition & 0 deletions src/messages/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ use crate::{

use bytes::Bytes;
use err_derive::Error;
use serde::{Deserialize, Serialize};
use std::fmt::{self, Debug, Formatter};
use xor_name::Prefix;

Expand Down
1 change: 1 addition & 0 deletions src/messages/plain_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// permissions and limitations relating to use of the SAFE Network Software.

use super::{DstLocation, SignableView, Variant};
use serde::{Deserialize, Serialize};
use xor_name::Prefix;

/// Section-source message without signature and proof.
Expand Down
2 changes: 1 addition & 1 deletion src/messages/src_authority.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::{
location::SrcLocation,
peer::Peer,
};

use serde::{Deserialize, Serialize};
use std::net::SocketAddr;
use xor_name::{Prefix, XorName};

Expand Down
2 changes: 1 addition & 1 deletion src/messages/variant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use crate::{
};
use bytes::Bytes;
use hex_fmt::HexFmt;
use serde::Serialize;
use serde::{Deserialize, Serialize};
use std::{
fmt::{self, Debug, Formatter},
net::SocketAddr,
Expand Down
2 changes: 1 addition & 1 deletion src/network/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use crate::{
section::{EldersInfo, SectionProofChain},
};

use serde::Serialize;
use serde::{Deserialize, Serialize};
use std::{collections::HashSet, iter};
use xor_name::{Prefix, XorName};

Expand Down
1 change: 1 addition & 0 deletions src/network/prefix_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// KIND, either express or implied. Please review the Licences for the specific language governing
// permissions and limitations relating to use of the SAFE Network Software.

use serde::{Deserialize, Serialize};
use std::{
borrow::Borrow,
cmp::Ordering,
Expand Down
2 changes: 1 addition & 1 deletion src/peer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// KIND, either express or implied. Please review the Licences for the specific language governing
// permissions and limitations relating to use of the SAFE Network Software.

use serde::Serialize;
use serde::{Deserialize, Serialize};
use std::{
fmt::{self, Display, Formatter},
hash::Hash,
Expand Down
1 change: 1 addition & 0 deletions src/section/member_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// permissions and limitations relating to use of the SAFE Network Software.

use crate::peer::Peer;
use serde::{Deserialize, Serialize};
use xor_name::XorName;

/// The minimum age a node can have. The Infants will start at age 4. This is to prevent frequent
Expand Down
2 changes: 1 addition & 1 deletion src/section/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use crate::{
rng, NetworkParams,
};
use bls_signature_aggregator::Proof;
use serde::Serialize;
use serde::{Deserialize, Serialize};
use std::{
cmp::Ordering,
collections::{BTreeMap, BTreeSet},
Expand Down
1 change: 1 addition & 0 deletions src/section/section_peers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use super::{
use crate::{consensus::Proven, peer::Peer};

use itertools::Itertools;
use serde::{Deserialize, Serialize};
use std::{
cmp::Ordering,
collections::{
Expand Down
1 change: 1 addition & 0 deletions src/section/section_proof_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// permissions and limitations relating to use of the SAFE Network Software.

use err_derive::Error;
use serde::{Deserialize, Serialize};
use std::{
collections::HashSet,
iter, mem,
Expand Down

0 comments on commit 2116420

Please sign in to comment.