Migrate network, primitives and rpc to the 2018 edition (#1710)

This commit is contained in:
Stanislav Tkach
2019-02-06 20:07:48 +02:00
committed by Gav Wood
parent 3a4dda7beb
commit e60be1ad12
43 changed files with 203 additions and 278 deletions
+6 -4
View File
@@ -21,8 +21,9 @@
use untrusted;
use blake2_rfc;
use ring::{rand, signature, signature::KeyPair};
use {hash::H512, Ed25519AuthorityId};
use crate::{hash::H512, Ed25519AuthorityId};
use base58::{ToBase58, FromBase58};
use parity_codec_derive::{Encode, Decode};
#[cfg(feature = "std")]
use serde::{de, Serializer, Deserializer, Deserialize};
@@ -190,7 +191,7 @@ impl ::std::fmt::Display for Public {
impl ::std::fmt::Debug for Public {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
let s = self.to_ss58check();
write!(f, "{} ({}...)", ::hexdisplay::HexDisplay::from(&self.0), &s[0..8])
write!(f, "{} ({}...)", crate::hexdisplay::HexDisplay::from(&self.0), &s[0..8])
}
}
@@ -295,10 +296,11 @@ pub fn serialize<S, T: AsRef<[u8; 32]>>(data: &T, serializer: S) -> Result<S::Ok
#[cfg(test)]
mod test {
use super::*;
use hex_literal::{hex, hex_impl};
fn _test_primitives_signature_and_local_the_same() {
fn takes_two<T>(_: T, _: T) { }
takes_two(Signature::default(), ::Signature::default())
takes_two(Signature::default(), crate::Signature::default())
}
#[test]
@@ -323,7 +325,7 @@ mod test {
#[test]
fn seeded_pair_should_work() {
use ::hexdisplay::HexDisplay;
use crate::hexdisplay::HexDisplay;
let pair = Pair::from_seed(b"12345678901234567890123456789012");
let public = pair.public();