Remove compilation warnings. (#2835)

* Remove compilation warnings.

* Allow unused only not in tests.

* Remove unnecessary mut.

* Make CI happy.

* Revert "Make CI happy."

This reverts commit abb865fe4b9fe9af1ae3ec801da9d4305ea35765.
This commit is contained in:
Tomasz Drwięga
2019-06-11 22:42:28 +02:00
committed by Bastian Köcher
parent ad2d958248
commit 6feab51069
5 changed files with 145 additions and 139 deletions
+136 -136
View File
File diff suppressed because it is too large Load Diff
-1
View File
@@ -46,7 +46,6 @@ use sr_api_macros::decl_runtime_apis;
use primitives::OpaqueMetadata;
#[cfg(feature = "std")]
use std::{panic::UnwindSafe, cell::RefCell, rc::Rc};
use rstd::vec::Vec;
#[cfg(feature = "std")]
use primitives::Hasher as HasherT;
+1 -1
View File
@@ -40,7 +40,7 @@ use consensus_common::import_queue::{
use client::{
block_builder::api::BlockBuilder as BlockBuilderApi,
blockchain::ProvideCache,
runtime_api::{ApiExt, Core as CoreApi},
runtime_api::ApiExt,
error::Result as CResult,
backend::AuxStore,
};
+7
View File
@@ -282,6 +282,10 @@ pub struct Peer<D, S: NetworkSpecialization<Block>> {
peer_id: PeerId,
client: PeersClient,
net_proto_channel: ProtocolChannel<S>,
/// This field is used only in test code, but maintaining different
/// instantiation paths or field names is too much hassle, hence
/// we allow it to be unused.
#[cfg_attr(not(test), allow(unused))]
protocol_status: Arc<RwLock<ProtocolStatus<Block>>>,
import_queue: Box<BasicQueue<Block>>,
pub data: D,
@@ -471,6 +475,7 @@ impl<D, S: NetworkSpecialization<Block>> Peer<D, S> {
self.net_proto_channel.send_from_client(ProtocolMsg::BlockImported(info.chain.best_hash, header));
}
#[cfg(test)]
fn on_block_imported(
&self,
hash: <Block as BlockT>::Hash,
@@ -492,6 +497,7 @@ impl<D, S: NetworkSpecialization<Block>> Peer<D, S> {
}
/// Get protocol status.
#[cfg(test)]
fn protocol_status(&self) -> ProtocolStatus<Block> {
self.protocol_status.read().clone()
}
@@ -608,6 +614,7 @@ impl<D, S: NetworkSpecialization<Block>> Peer<D, S> {
}
/// Announce a block to peers.
#[cfg(test)]
fn announce_block(&self, block: Hash) {
self.net_proto_channel.send_from_client(ProtocolMsg::AnnounceBlock(block));
}
@@ -217,7 +217,7 @@ fn decl_store_extra_genesis(
let type_infos = get_type_infos(storage_type);
let mut opt_build;
let opt_build;
// need build line
if let Some(ref config) = config.inner {
let ident = if let Some(ident) = config.expr.content.as_ref() {