Migrate sr-primitives, sr-sandbox, sr-std and sr-version to the 2018 edition (#1694)

This commit is contained in:
Stanislav Tkach
2019-02-06 20:04:14 +02:00
committed by Gav Wood
parent 4e3eace15f
commit 3a4dda7beb
24 changed files with 113 additions and 122 deletions
+10 -8
View File
@@ -21,9 +21,11 @@ use rstd::{self, result, marker::PhantomData};
use runtime_io;
#[cfg(feature = "std")] use std::fmt::{Debug, Display};
#[cfg(feature = "std")] use serde::{Serialize, de::DeserializeOwned};
#[cfg(feature = "std")]
use serde_derive::{Serialize, Deserialize};
use substrate_primitives;
use substrate_primitives::Blake2Hasher;
use codec::{Codec, Encode, HasCompact};
use crate::codec::{Codec, Encode, HasCompact};
pub use integer_sqrt::IntegerSquareRoot;
pub use num_traits::{Zero, One, Bounded};
pub use num_traits::ops::checked::{
@@ -147,7 +149,7 @@ pub trait As<T> {
/// Convert forward (ala `Into::into`).
fn as_(self) -> T;
/// Convert backward (ala `From::from`).
fn sa(T) -> Self;
fn sa(_: T) -> Self;
}
macro_rules! impl_numerics {
@@ -518,29 +520,29 @@ pub trait Header: Clone + Send + Sync + Codec + Eq + MaybeSerializeDebugButNotDe
/// Returns a reference to the header number.
fn number(&self) -> &Self::Number;
/// Sets the header number.
fn set_number(&mut self, Self::Number);
fn set_number(&mut self, number: Self::Number);
/// Returns a reference to the extrinsics root.
fn extrinsics_root(&self) -> &Self::Hash;
/// Sets the extrinsic root.
fn set_extrinsics_root(&mut self, Self::Hash);
fn set_extrinsics_root(&mut self, root: Self::Hash);
/// Returns a reference to the state root.
fn state_root(&self) -> &Self::Hash;
/// Sets the state root.
fn set_state_root(&mut self, Self::Hash);
fn set_state_root(&mut self, root: Self::Hash);
/// Returns a reference to the parent hash.
fn parent_hash(&self) -> &Self::Hash;
/// Sets the parent hash.
fn set_parent_hash(&mut self, Self::Hash);
fn set_parent_hash(&mut self, hash: Self::Hash);
/// Returns a reference to the digest.
fn digest(&self) -> &Self::Digest;
/// Get a mutable reference to the digest.
fn digest_mut(&mut self) -> &mut Self::Digest;
/// Sets the digest.
fn set_digest(&mut self, Self::Digest);
fn set_digest(&mut self, digest: Self::Digest);
/// Returns the hash of the header.
fn hash(&self) -> Self::Hash {
@@ -676,7 +678,7 @@ pub trait DigestItem: Codec + Member + MaybeSerializeDebugButNotDeserialize {
/// `ChangesTrieRoot` payload.
type Hash: Member;
/// `AuthorityChange` payload.
type AuthorityId: Member + MaybeHash + codec::Encode + codec::Decode;
type AuthorityId: Member + MaybeHash + crate::codec::Encode + crate::codec::Decode;
/// Returns Some if the entry is the `AuthoritiesChange` entry.
fn as_authorities_change(&self) -> Option<&[Self::AuthorityId]>;