diff --git a/substrate/node/runtime/src/lib.rs b/substrate/node/runtime/src/lib.rs index d1b9abd4cf..0c5cdefd96 100644 --- a/substrate/node/runtime/src/lib.rs +++ b/substrate/node/runtime/src/lib.rs @@ -80,7 +80,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // implementation changes and behavior does not, then leave spec_version as // is and increment impl_version. spec_version: 151, - impl_version: 151, + impl_version: 152, apis: RUNTIME_API_VERSIONS, }; diff --git a/substrate/srml/aura/src/lib.rs b/substrate/srml/aura/src/lib.rs index e02a2e1f0a..4df832912a 100644 --- a/substrate/srml/aura/src/lib.rs +++ b/substrate/srml/aura/src/lib.rs @@ -258,7 +258,7 @@ impl Module { fn on_timestamp_set(now: T::Moment, slot_duration: T::Moment) { let last = Self::last(); - ::LastTimestamp::put(now.clone()); + ::LastTimestamp::put(now); if last.is_zero() { return; @@ -266,7 +266,7 @@ impl Module { assert!(!slot_duration.is_zero(), "Aura slot duration cannot be zero."); - let last_slot = last / slot_duration.clone(); + let last_slot = last / slot_duration; let cur_slot = now / slot_duration; assert!(last_slot < cur_slot, "Only one block may be authored per slot."); diff --git a/substrate/srml/democracy/src/lib.rs b/substrate/srml/democracy/src/lib.rs index d4cfedc37b..f1265438f2 100644 --- a/substrate/srml/democracy/src/lib.rs +++ b/substrate/srml/democracy/src/lib.rs @@ -946,12 +946,12 @@ impl Module { if (now % T::LaunchPeriod::get()).is_zero() { // Errors come from the queue being empty. we don't really care about that, and even if // we did, there is nothing we can do here. - let _ = Self::launch_next(now.clone()); + let _ = Self::launch_next(now); } // tally up votes for any expiring referenda. for (index, info) in Self::maturing_referenda_at(now).into_iter() { - Self::bake_referendum(now.clone(), index, info)?; + Self::bake_referendum(now, index, info)?; } for (proposal, index) in >::take(now).into_iter().filter_map(|x| x) { diff --git a/substrate/srml/staking/src/lib.rs b/substrate/srml/staking/src/lib.rs index a4d1ed88ab..2e46d6b2b4 100644 --- a/substrate/srml/staking/src/lib.rs +++ b/substrate/srml/staking/src/lib.rs @@ -1179,7 +1179,7 @@ impl Module { let rewards = CurrentEraRewards::take(); let now = T::Time::now(); let previous_era_start = >::mutate(|v| { - rstd::mem::replace(v, now.clone()) + rstd::mem::replace(v, now) }); let era_duration = now - previous_era_start; if !era_duration.is_zero() { diff --git a/substrate/srml/support/src/traits.rs b/substrate/srml/support/src/traits.rs index cca9fd2b10..37262cdfcb 100644 --- a/substrate/srml/support/src/traits.rs +++ b/substrate/srml/support/src/traits.rs @@ -620,7 +620,7 @@ bitmask! { } pub trait Time { - type Moment: SimpleArithmetic + Codec + Clone + Default; + type Moment: SimpleArithmetic + Codec + Clone + Default + Copy; fn now() -> Self::Moment; } diff --git a/substrate/srml/timestamp/src/lib.rs b/substrate/srml/timestamp/src/lib.rs index 78a741aff4..1b03b5b9af 100644 --- a/substrate/srml/timestamp/src/lib.rs +++ b/substrate/srml/timestamp/src/lib.rs @@ -195,9 +195,9 @@ macro_rules! impl_timestamp_set { ); ( $($t:ident)* ) => { - impl),*> OnTimestampSet for ($($t,)*) { + impl),*> OnTimestampSet for ($($t,)*) { fn on_timestamp_set(moment: Moment) { - $($t::on_timestamp_set(moment.clone());)* + $($t::on_timestamp_set(moment);)* } } } @@ -209,7 +209,7 @@ for_each_tuple!(impl_timestamp_set); pub trait Trait: system::Trait { /// Type used for expressing timestamp. type Moment: Parameter + Default + SimpleArithmetic - + Scale; + + Scale + Copy; /// Something which can be notified when the timestamp is set. Set this to `()` if not needed. type OnTimestampSet: OnTimestampSet; @@ -246,7 +246,7 @@ decl_module! { Self::now().is_zero() || now >= Self::now() + T::MinimumPeriod::get(), "Timestamp must increment by at least between sequential blocks" ); - ::Now::put(now.clone()); + ::Now::put(now); ::DidUpdate::put(true); >::on_timestamp_set(now);