Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/node/cli/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ mod tests {
RuntimeAppPublic,
};
use sp_timestamp;
use std::{borrow::Cow, convert::TryInto, sync::Arc};
use std::{borrow::Cow, sync::Arc};

type AccountPublic = <Signature as Verify>::Signer;

Expand Down
1 change: 0 additions & 1 deletion bin/node/cli/tests/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ use nix::{
use node_primitives::Block;
use remote_externalities::rpc_api;
use std::{
convert::TryInto,
ops::{Deref, DerefMut},
path::Path,
process::{Child, Command, ExitStatus},
Expand Down
5 changes: 1 addition & 4 deletions bin/node/cli/tests/running_the_node_and_interrupt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ use nix::{
},
unistd::Pid,
};
use std::{
convert::TryInto,
process::{Child, Command},
};
use std::process::{Child, Command};
use tempfile::tempdir;

pub mod common;
Expand Down
2 changes: 1 addition & 1 deletion bin/node/cli/tests/telemetry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use nix::{
sys::signal::{kill, Signal::SIGINT},
unistd::Pid,
};
use std::{convert::TryInto, process};
use std::process;

pub mod common;
pub mod websocket_server;
Expand Down
1 change: 0 additions & 1 deletion bin/node/cli/tests/temp_base_path_works.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ use nix::{
};
use regex::Regex;
use std::{
convert::TryInto,
io::Read,
path::PathBuf,
process::{Command, Stdio},
Expand Down
1 change: 0 additions & 1 deletion client/allocator/src/freeing_bump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ use crate::Error;
pub use sp_core::MAX_POSSIBLE_ALLOCATION;
use sp_wasm_interface::{Pointer, WordSize};
use std::{
convert::{TryFrom, TryInto},
mem,
ops::{Index, IndexMut, Range},
};
Expand Down
2 changes: 1 addition & 1 deletion client/api/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use sp_runtime::{
traits::{Block as BlockT, NumberFor},
Justifications,
};
use std::{collections::HashSet, convert::TryFrom, fmt, sync::Arc};
use std::{collections::HashSet, fmt, sync::Arc};

use crate::{blockchain::Info, notifications::StorageEventStream, FinalizeSummary, ImportSummary};

Expand Down
10 changes: 3 additions & 7 deletions client/authority-discovery/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ use crate::{

use std::{
collections::{HashMap, HashSet},
convert::TryInto,
marker::PhantomData,
sync::Arc,
time::Duration,
Expand Down Expand Up @@ -581,14 +580,11 @@ where
.authorities(&id)
.map_err(|e| Error::CallingRuntime(e.into()))?
.into_iter()
.map(std::convert::Into::into)
.map(Into::into)
.collect::<HashSet<_>>();

let intersection = local_pub_keys
.intersection(&authorities)
.cloned()
.map(std::convert::Into::into)
.collect();
let intersection =
local_pub_keys.intersection(&authorities).cloned().map(Into::into).collect();

Ok(intersection)
}
Expand Down
2 changes: 0 additions & 2 deletions client/beefy/src/keystore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

use std::convert::{From, TryInto};

use sp_application_crypto::RuntimeAppPublic;
use sp_core::keccak_256;
use sp_keystore::{SyncCryptoStore, SyncCryptoStorePtr};
Expand Down
2 changes: 1 addition & 1 deletion client/cli/src/commands/insert_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use sc_keystore::LocalKeystore;
use sc_service::config::{BasePath, KeystoreConfig};
use sp_core::crypto::{KeyTypeId, SecretString};
use sp_keystore::{SyncCryptoStore, SyncCryptoStorePtr};
use std::{convert::TryFrom, sync::Arc};
use std::sync::Arc;

/// The `insert` command
#[derive(Debug, Clone, Parser)]
Expand Down
2 changes: 1 addition & 1 deletion client/cli/src/commands/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use sp_core::{
Pair,
};
use sp_runtime::{traits::IdentifyAccount, MultiSigner};
use std::{convert::TryFrom, io::Read, path::PathBuf};
use std::{io::Read, path::PathBuf};

/// Public key type for Runtime
pub type PublicFor<P> = <P as sp_core::Pair>::Public;
Expand Down
2 changes: 1 addition & 1 deletion client/cli/src/commands/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl VerifyCmd {
fn verify<Pair>(sig_data: Vec<u8>, message: Vec<u8>, uri: &str) -> error::Result<()>
where
Pair: sp_core::Pair,
Pair::Signature: for<'a> std::convert::TryFrom<&'a [u8]>,
Pair::Signature: for<'a> TryFrom<&'a [u8]>,
{
let signature =
Pair::Signature::try_from(&sig_data).map_err(|_| error::Error::SignatureFormatInvalid)?;
Expand Down
6 changes: 3 additions & 3 deletions client/cli/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,19 @@ pub enum Error {
GlobalLoggerError(#[from] sc_tracing::logging::Error),
}

impl std::convert::From<&str> for Error {
impl From<&str> for Error {
fn from(s: &str) -> Error {
Error::Input(s.to_string())
}
}

impl std::convert::From<String> for Error {
impl From<String> for Error {
fn from(s: String) -> Error {
Error::Input(s)
}
}

impl std::convert::From<crypto::PublicError> for Error {
impl From<crypto::PublicError> for Error {
fn from(e: crypto::PublicError) -> Error {
Error::InvalidUri(e)
}
Expand Down
2 changes: 1 addition & 1 deletion client/cli/src/params/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use sp_runtime::{
generic::BlockId,
traits::{Block as BlockT, NumberFor},
};
use std::{convert::TryFrom, fmt::Debug, str::FromStr};
use std::{fmt::Debug, str::FromStr};

pub use crate::params::{
database_params::*, import_params::*, keystore_params::*, network_params::*,
Expand Down
11 changes: 2 additions & 9 deletions client/consensus/aura/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,7 @@
//!
//! NOTE: Aura itself is designed to be generic over the crypto used.
#![forbid(missing_docs, unsafe_code)]
use std::{
convert::{TryFrom, TryInto},
fmt::Debug,
hash::Hash,
marker::PhantomData,
pin::Pin,
sync::Arc,
};
use std::{fmt::Debug, hash::Hash, marker::PhantomData, pin::Pin, sync::Arc};

use futures::prelude::*;
use log::{debug, trace};
Expand Down Expand Up @@ -517,7 +510,7 @@ pub enum Error<B: BlockT> {
Inherent(sp_inherents::Error),
}

impl<B: BlockT> std::convert::From<Error<B>> for String {
impl<B: BlockT> From<Error<B>> for String {
fn from(error: Error<B>) -> String {
error.to_string()
}
Expand Down
3 changes: 1 addition & 2 deletions client/consensus/babe/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
use std::{
borrow::Cow,
collections::{HashMap, HashSet},
convert::TryInto,
future::Future,
pin::Pin,
sync::Arc,
Expand Down Expand Up @@ -320,7 +319,7 @@ pub enum Error<B: BlockT> {
ForkTree(Box<fork_tree::Error<sp_blockchain::Error>>),
}

impl<B: BlockT> std::convert::From<Error<B>> for String {
impl<B: BlockT> From<Error<B>> for String {
fn from(error: Error<B>) -> String {
error.to_string()
}
Expand Down
2 changes: 1 addition & 1 deletion client/consensus/manual-seal/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ impl Error {
}
}

impl std::convert::From<Error> for jsonrpc_core::Error {
impl From<Error> for jsonrpc_core::Error {
fn from(error: Error) -> Self {
jsonrpc_core::Error {
code: jsonrpc_core::ErrorCode::ServerError(error.to_code()),
Expand Down
4 changes: 2 additions & 2 deletions client/consensus/pow/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,13 @@ pub enum Error<B: BlockT> {
Other(String),
}

impl<B: BlockT> std::convert::From<Error<B>> for String {
impl<B: BlockT> From<Error<B>> for String {
fn from(error: Error<B>) -> String {
error.to_string()
}
}

impl<B: BlockT> std::convert::From<Error<B>> for ConsensusError {
impl<B: BlockT> From<Error<B>> for ConsensusError {
fn from(error: Error<B>) -> ConsensusError {
ConsensusError::ClientImport(error.to_string())
}
Expand Down
2 changes: 1 addition & 1 deletion client/db/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//! Db-based backend utility structures and functions, used by both
//! full and light storages.

use std::{convert::TryInto, fmt, fs, io, path::Path, sync::Arc};
use std::{fmt, fs, io, path::Path, sync::Arc};

use log::{debug, info};

Expand Down
2 changes: 1 addition & 1 deletion client/executor/common/src/sandbox/wasmer_backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use crate::{
use codec::{Decode, Encode};
use sp_core::sandbox::HostError;
use sp_wasm_interface::{FunctionContext, Pointer, ReturnValue, Value, WordSize};
use std::{cell::RefCell, collections::HashMap, convert::TryInto, rc::Rc};
use std::{cell::RefCell, collections::HashMap, rc::Rc};
use wasmer::RuntimeError;

use crate::sandbox::{
Expand Down
2 changes: 1 addition & 1 deletion client/finality-grandpa/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ where
mod tests {
use super::*;
use jsonrpc_core::{types::Params, Notification, Output};
use std::{collections::HashSet, convert::TryInto, sync::Arc};
use std::{collections::HashSet, sync::Arc};

use parity_scale_codec::{Decode, Encode};
use sc_block_builder::{BlockBuilder, RecordProof};
Expand Down
6 changes: 1 addition & 5 deletions client/informant/src/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ use log::info;
use sc_client_api::ClientInfo;
use sc_network::{NetworkStatus, SyncState, WarpSyncPhase, WarpSyncProgress};
use sp_runtime::traits::{Block as BlockT, CheckedDiv, NumberFor, Saturating, Zero};
use std::{
convert::{TryFrom, TryInto},
fmt,
time::Instant,
};
use std::{fmt, time::Instant};

/// State of the informant display system.
///
Expand Down
1 change: 0 additions & 1 deletion client/network-gossip/src/bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ mod tests {
use sp_runtime::{testing::H256, traits::Block as BlockT};
use std::{
borrow::Cow,
convert::TryInto,
sync::{Arc, Mutex},
};
use substrate_test_runtime_client::runtime::Block;
Expand Down
1 change: 0 additions & 1 deletion client/network/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ use sp_runtime::traits::Block as BlockT;
use std::{
borrow::Cow,
collections::HashMap,
convert::TryFrom,
error::Error,
fs,
future::Future,
Expand Down
1 change: 0 additions & 1 deletion client/network/src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ use sp_runtime::{
use std::{
borrow::Cow,
collections::{HashMap, HashSet, VecDeque},
convert::TryFrom as _,
io, iter,
num::NonZeroUsize,
pin::Pin,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ use libp2p::core::{upgrade, InboundUpgrade, OutboundUpgrade, UpgradeInfo};
use log::{error, warn};
use std::{
borrow::Cow,
convert::{Infallible, TryFrom as _},
convert::Infallible,
io, mem,
pin::Pin,
task::{Context, Poll},
Expand Down
1 change: 0 additions & 1 deletion client/network/src/request_responses.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ use libp2p::{
use std::{
borrow::Cow,
collections::{hash_map::Entry, HashMap},
convert::TryFrom as _,
io, iter,
pin::Pin,
task::{Context, Poll},
Expand Down
1 change: 0 additions & 1 deletion client/network/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ use std::{
borrow::Cow,
cmp,
collections::{HashMap, HashSet},
convert::TryFrom as _,
fs, iter,
marker::PhantomData,
num::NonZeroUsize,
Expand Down
1 change: 0 additions & 1 deletion client/network/src/service/out_events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ use parking_lot::Mutex;
use prometheus_endpoint::{register, CounterVec, GaugeVec, Opts, PrometheusError, Registry, U64};
use std::{
cell::RefCell,
convert::TryFrom as _,
fmt,
pin::Pin,
sync::Arc,
Expand Down
7 changes: 2 additions & 5 deletions client/offchain/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

use std::{collections::HashSet, convert::TryFrom, str::FromStr, sync::Arc, thread::sleep};
use std::{collections::HashSet, str::FromStr, sync::Arc, thread::sleep};

use crate::NetworkProvider;
use codec::{Decode, Encode};
Expand Down Expand Up @@ -327,10 +327,7 @@ mod tests {
use sc_client_db::offchain::LocalStorage;
use sc_network::{NetworkStateInfo, PeerId};
use sp_core::offchain::{DbExternalities, Externalities};
use std::{
convert::{TryFrom, TryInto},
time::SystemTime,
};
use std::time::SystemTime;

pub(super) struct TestNetwork();

Expand Down
1 change: 0 additions & 1 deletion client/offchain/src/api/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ use once_cell::sync::Lazy;
use sc_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender};
use sp_core::offchain::{HttpError, HttpRequestId, HttpRequestStatus, Timestamp};
use std::{
convert::TryFrom,
fmt,
io::Read as _,
pin::Pin,
Expand Down
5 changes: 1 addition & 4 deletions client/offchain/src/api/timestamp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@
//! Helper methods dedicated to timestamps.

use sp_core::offchain::Timestamp;
use std::{
convert::TryInto,
time::{Duration, SystemTime},
};
use std::time::{Duration, SystemTime};

/// Returns the current time as a `Timestamp`.
pub fn now() -> Timestamp {
Expand Down
2 changes: 1 addition & 1 deletion client/rpc/src/author/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#[cfg(test)]
mod tests;

use std::{convert::TryInto, sync::Arc};
use std::sync::Arc;

use sp_blockchain::HeaderBackend;

Expand Down
1 change: 0 additions & 1 deletion client/service/src/chain_ops/import_blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ use sp_runtime::{
},
};
use std::{
convert::{TryFrom, TryInto},
io::Read,
pin::Pin,
task::Poll,
Expand Down
2 changes: 1 addition & 1 deletion client/service/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ impl BasePath {
}
}

impl std::convert::From<PathBuf> for BasePath {
impl From<PathBuf> for BasePath {
fn from(path: PathBuf) -> Self {
BasePath::new(path)
}
Expand Down
2 changes: 1 addition & 1 deletion client/service/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

use std::{convert::TryFrom, time::SystemTime};
use std::time::SystemTime;

use crate::config::Configuration;
use futures_timer::Delay;
Expand Down
Loading