diff --git a/polkadot/bridges/bin/runtime-common/src/messages.rs b/polkadot/bridges/bin/runtime-common/src/messages.rs index 250b68ceff..b39decbc6f 100644 --- a/polkadot/bridges/bin/runtime-common/src/messages.rs +++ b/polkadot/bridges/bin/runtime-common/src/messages.rs @@ -42,10 +42,7 @@ use sp_runtime::{ traits::{AtLeast32BitUnsigned, CheckedAdd, CheckedDiv, CheckedMul, Saturating, Zero}, FixedPointNumber, FixedPointOperand, FixedU128, }; -use sp_std::{ - cmp::PartialOrd, convert::TryFrom, fmt::Debug, marker::PhantomData, ops::RangeInclusive, - vec::Vec, -}; +use sp_std::{cmp::PartialOrd, fmt::Debug, marker::PhantomData, ops::RangeInclusive, vec::Vec}; use sp_trie::StorageProof; /// Bidirectional message bridge. diff --git a/polkadot/bridges/modules/grandpa/src/lib.rs b/polkadot/bridges/modules/grandpa/src/lib.rs index 947bfdc7f6..9b04f3635c 100644 --- a/polkadot/bridges/modules/grandpa/src/lib.rs +++ b/polkadot/bridges/modules/grandpa/src/lib.rs @@ -45,7 +45,7 @@ use frame_support::{ensure, fail}; use frame_system::{ensure_signed, RawOrigin}; use sp_finality_grandpa::{ConsensusLog, GRANDPA_ENGINE_ID}; use sp_runtime::traits::{BadOrigin, Header as HeaderT, Zero}; -use sp_std::{boxed::Box, convert::TryInto}; +use sp_std::boxed::Box; #[cfg(test)] mod mock; diff --git a/polkadot/bridges/modules/messages/src/benchmarking.rs b/polkadot/bridges/modules/messages/src/benchmarking.rs index 46a8150d03..828a9ee653 100644 --- a/polkadot/bridges/modules/messages/src/benchmarking.rs +++ b/polkadot/bridges/modules/messages/src/benchmarking.rs @@ -30,7 +30,7 @@ use bp_runtime::messages::DispatchFeePayment; use frame_benchmarking::{account, benchmarks_instance_pallet}; use frame_support::{traits::Get, weights::Weight}; use frame_system::RawOrigin; -use sp_std::{collections::vec_deque::VecDeque, convert::TryInto, ops::RangeInclusive, prelude::*}; +use sp_std::{collections::vec_deque::VecDeque, ops::RangeInclusive, prelude::*}; const SEED: u32 = 0; diff --git a/polkadot/bridges/primitives/runtime/src/chain.rs b/polkadot/bridges/primitives/runtime/src/chain.rs index 5a7fafe9f6..659c9f47c5 100644 --- a/polkadot/bridges/primitives/runtime/src/chain.rs +++ b/polkadot/bridges/primitives/runtime/src/chain.rs @@ -24,7 +24,7 @@ use sp_runtime::{ }, FixedPointOperand, }; -use sp_std::{convert::TryFrom, fmt::Debug, hash::Hash, str::FromStr, vec, vec::Vec}; +use sp_std::{fmt::Debug, hash::Hash, str::FromStr, vec, vec::Vec}; /// Chain call, that is either SCALE-encoded, or decoded. #[derive(Debug, Clone, PartialEq)] diff --git a/polkadot/bridges/primitives/runtime/src/lib.rs b/polkadot/bridges/primitives/runtime/src/lib.rs index 1d8a40339a..f4e6595994 100644 --- a/polkadot/bridges/primitives/runtime/src/lib.rs +++ b/polkadot/bridges/primitives/runtime/src/lib.rs @@ -22,7 +22,7 @@ use codec::Encode; use frame_support::{RuntimeDebug, StorageHasher}; use sp_core::{hash::H256, storage::StorageKey}; use sp_io::hashing::blake2_256; -use sp_std::{convert::TryFrom, vec, vec::Vec}; +use sp_std::{vec, vec::Vec}; pub use chain::{ AccountIdOf, AccountPublicOf, BalanceOf, BlockNumberOf, Chain, EncodedOrDecodedCall, HashOf, diff --git a/polkadot/bridges/primitives/test-utils/src/lib.rs b/polkadot/bridges/primitives/test-utils/src/lib.rs index 9e044ed472..38d9453c98 100644 --- a/polkadot/bridges/primitives/test-utils/src/lib.rs +++ b/polkadot/bridges/primitives/test-utils/src/lib.rs @@ -20,7 +20,6 @@ use bp_header_chain::justification::GrandpaJustification; use codec::Encode; -use sp_application_crypto::TryFrom; use sp_finality_grandpa::{AuthorityId, AuthoritySignature, AuthorityWeight, SetId}; use sp_runtime::traits::{Header as HeaderT, One, Zero}; use sp_std::prelude::*; diff --git a/polkadot/bridges/relays/bin-substrate/src/cli/mod.rs b/polkadot/bridges/relays/bin-substrate/src/cli/mod.rs index 9842f300d1..d931915a9b 100644 --- a/polkadot/bridges/relays/bin-substrate/src/cli/mod.rs +++ b/polkadot/bridges/relays/bin-substrate/src/cli/mod.rs @@ -16,8 +16,6 @@ //! Deal with CLI args of substrate-to-substrate relay. -use std::convert::TryInto; - use codec::{Decode, Encode}; use relay_substrate_client::ChainRuntimeVersion; use sp_runtime::app_crypto::Ss58Codec; diff --git a/polkadot/bridges/relays/bin-substrate/src/cli/reinit_bridge.rs b/polkadot/bridges/relays/bin-substrate/src/cli/reinit_bridge.rs index 89470872cb..957d082d5f 100644 --- a/polkadot/bridges/relays/bin-substrate/src/cli/reinit_bridge.rs +++ b/polkadot/bridges/relays/bin-substrate/src/cli/reinit_bridge.rs @@ -36,7 +36,6 @@ use relay_substrate_client::{ SyncHeader, TransactionEra, TransactionSignScheme, UnsignedTransaction, }; use sp_core::{Bytes, Pair}; -use std::convert::{TryFrom, TryInto}; use structopt::StructOpt; use strum::{EnumString, EnumVariantNames, VariantNames}; use substrate_relay_helper::{ diff --git a/polkadot/bridges/relays/client-substrate/src/client.rs b/polkadot/bridges/relays/client-substrate/src/client.rs index 1e48bc3339..3725aa3ff4 100644 --- a/polkadot/bridges/relays/client-substrate/src/client.rs +++ b/polkadot/bridges/relays/client-substrate/src/client.rs @@ -47,7 +47,7 @@ use sp_runtime::{ }; use sp_trie::StorageProof; use sp_version::RuntimeVersion; -use std::{convert::TryFrom, future::Future}; +use std::future::Future; const SUB_API_GRANDPA_AUTHORITIES: &str = "GrandpaApi_grandpa_authorities"; const SUB_API_TXPOOL_VALIDATE_TRANSACTION: &str = "TaggedTransactionQueue_validate_transaction"; diff --git a/polkadot/bridges/relays/lib-substrate-relay/src/messages_lane.rs b/polkadot/bridges/relays/lib-substrate-relay/src/messages_lane.rs index fadf5e6224..775249e9e2 100644 --- a/polkadot/bridges/relays/lib-substrate-relay/src/messages_lane.rs +++ b/polkadot/bridges/relays/lib-substrate-relay/src/messages_lane.rs @@ -40,7 +40,7 @@ use relay_substrate_client::{ }; use relay_utils::metrics::MetricsParams; use sp_core::Pair; -use std::{convert::TryFrom, fmt::Debug, marker::PhantomData}; +use std::{fmt::Debug, marker::PhantomData}; /// Substrate -> Substrate messages synchronization pipeline. pub trait SubstrateMessageLane: 'static + Clone + Debug + Send + Sync { diff --git a/polkadot/bridges/relays/lib-substrate-relay/src/messages_metrics.rs b/polkadot/bridges/relays/lib-substrate-relay/src/messages_metrics.rs index b165892fda..918449e509 100644 --- a/polkadot/bridges/relays/lib-substrate-relay/src/messages_metrics.rs +++ b/polkadot/bridges/relays/lib-substrate-relay/src/messages_metrics.rs @@ -32,7 +32,7 @@ use relay_utils::metrics::{ }; use sp_core::storage::StorageData; use sp_runtime::{FixedPointNumber, FixedU128}; -use std::{convert::TryFrom, fmt::Debug, marker::PhantomData}; +use std::{fmt::Debug, marker::PhantomData}; /// Name of the `NextFeeMultiplier` storage value within the transaction payment pallet. const NEXT_FEE_MULTIPLIER_VALUE_NAME: &str = "NextFeeMultiplier"; diff --git a/polkadot/bridges/relays/lib-substrate-relay/src/messages_target.rs b/polkadot/bridges/relays/lib-substrate-relay/src/messages_target.rs index 869a1d2802..d23c2d1f19 100644 --- a/polkadot/bridges/relays/lib-substrate-relay/src/messages_target.rs +++ b/polkadot/bridges/relays/lib-substrate-relay/src/messages_target.rs @@ -49,7 +49,7 @@ use relay_substrate_client::{ use relay_utils::{relay_loop::Client as RelayClient, HeaderId}; use sp_core::{Bytes, Pair}; use sp_runtime::{traits::Saturating, FixedPointNumber, FixedU128}; -use std::{collections::VecDeque, convert::TryFrom, ops::RangeInclusive}; +use std::{collections::VecDeque, ops::RangeInclusive}; /// Message receiving proof returned by the target Substrate node. pub type SubstrateMessagesDeliveryProof = diff --git a/polkadot/cli/src/command.rs b/polkadot/cli/src/command.rs index e3945e784f..b04c4ee1e6 100644 --- a/polkadot/cli/src/command.rs +++ b/polkadot/cli/src/command.rs @@ -25,7 +25,7 @@ use std::net::ToSocketAddrs; pub use crate::{error::Error, service::BlockId}; pub use polkadot_performance_test::PerfCheckError; -impl std::convert::From for Error { +impl From for Error { fn from(s: String) -> Self { Self::Other(s) } diff --git a/polkadot/erasure-coding/src/lib.rs b/polkadot/erasure-coding/src/lib.rs index e9020faebf..8c9f6f07d0 100644 --- a/polkadot/erasure-coding/src/lib.rs +++ b/polkadot/erasure-coding/src/lib.rs @@ -24,8 +24,6 @@ //! f is the maximum number of faulty validators in the system. //! The data is coded so any f+1 chunks can be used to reconstruct the full data. -use std::convert::TryFrom; - use parity_scale_codec::{Decode, Encode}; use polkadot_node_primitives::{AvailableData, Proof}; use polkadot_primitives::v2::{BlakeTwo256, Hash as H256, HashT}; diff --git a/polkadot/node/core/approval-voting/src/import.rs b/polkadot/node/core/approval-voting/src/import.rs index 7a3789209d..7bfddb2787 100644 --- a/polkadot/node/core/approval-voting/src/import.rs +++ b/polkadot/node/core/approval-voting/src/import.rs @@ -54,7 +54,7 @@ use sp_consensus_slots::Slot; use bitvec::order::Lsb0 as BitOrderLsb0; use futures::{channel::oneshot, prelude::*}; -use std::{collections::HashMap, convert::TryFrom}; +use std::collections::HashMap; use super::approval_db::v1; use crate::{ diff --git a/polkadot/node/core/approval-voting/src/ops.rs b/polkadot/node/core/approval-voting/src/ops.rs index 47a2dc805f..d0699e8026 100644 --- a/polkadot/node/core/approval-voting/src/ops.rs +++ b/polkadot/node/core/approval-voting/src/ops.rs @@ -22,10 +22,7 @@ use polkadot_node_subsystem::SubsystemResult; use bitvec::order::Lsb0 as BitOrderLsb0; use polkadot_primitives::v2::{BlockNumber, CandidateHash, CandidateReceipt, GroupIndex, Hash}; -use std::{ - collections::{hash_map::Entry, BTreeMap, HashMap}, - convert::Into, -}; +use std::collections::{hash_map::Entry, BTreeMap, HashMap}; use super::{ approval_db::v1::{OurAssignment, StoredBlockRange}, diff --git a/polkadot/node/core/av-store/src/metrics.rs b/polkadot/node/core/av-store/src/metrics.rs index 4ebc8a3f6d..c50932c617 100644 --- a/polkadot/node/core/av-store/src/metrics.rs +++ b/polkadot/node/core/av-store/src/metrics.rs @@ -35,7 +35,6 @@ pub struct Metrics(Option); impl Metrics { pub(crate) fn on_chunks_received(&self, count: usize) { if let Some(metrics) = &self.0 { - use core::convert::TryFrom as _; // assume usize fits into u64 let by = u64::try_from(count).unwrap_or_default(); metrics.received_availability_chunks_total.inc_by(by); diff --git a/polkadot/node/core/av-store/src/tests.rs b/polkadot/node/core/av-store/src/tests.rs index 76b3560763..f1e04faa3f 100644 --- a/polkadot/node/core/av-store/src/tests.rs +++ b/polkadot/node/core/av-store/src/tests.rs @@ -16,8 +16,6 @@ use super::*; -use std::convert::TryFrom; - use assert_matches::assert_matches; use futures::{channel::oneshot, executor, future, Future}; diff --git a/polkadot/node/core/backing/src/tests.rs b/polkadot/node/core/backing/src/tests.rs index a6316df34a..47b78bfc28 100644 --- a/polkadot/node/core/backing/src/tests.rs +++ b/polkadot/node/core/backing/src/tests.rs @@ -1456,7 +1456,6 @@ fn validation_work_ignores_wrong_collator() { #[test] fn candidate_backing_reorders_votes() { use sp_core::Encode; - use std::convert::TryFrom; let para_id = ParaId::from(10); let validators = vec![ diff --git a/polkadot/node/core/provisioner/src/metrics.rs b/polkadot/node/core/provisioner/src/metrics.rs index db3fe7b4b0..e082f41dbb 100644 --- a/polkadot/node/core/provisioner/src/metrics.rs +++ b/polkadot/node/core/provisioner/src/metrics.rs @@ -15,7 +15,6 @@ // along with Polkadot. If not, see . use polkadot_node_subsystem_util::metrics::{self, prometheus}; -use std::convert::TryInto; #[derive(Clone)] struct MetricsInner { diff --git a/polkadot/node/metrics/src/tests.rs b/polkadot/node/metrics/src/tests.rs index 75c67331fe..50dc2cf711 100644 --- a/polkadot/node/metrics/src/tests.rs +++ b/polkadot/node/metrics/src/tests.rs @@ -21,7 +21,7 @@ use polkadot_test_service::{node_config, run_validator_node, test_prometheus_con use primitives::v2::metric_definitions::PARACHAIN_INHERENT_DATA_BITFIELDS_PROCESSED; use sc_client_api::{execution_extensions::ExecutionStrategies, ExecutionStrategy}; use sp_keyring::AccountKeyring::*; -use std::{collections::HashMap, convert::TryFrom}; +use std::collections::HashMap; const DEFAULT_PROMETHEUS_PORT: u16 = 9616; diff --git a/polkadot/node/network/availability-distribution/src/requester/fetch_task/tests.rs b/polkadot/node/network/availability-distribution/src/requester/fetch_task/tests.rs index 1b035fe8dc..db43610543 100644 --- a/polkadot/node/network/availability-distribution/src/requester/fetch_task/tests.rs +++ b/polkadot/node/network/availability-distribution/src/requester/fetch_task/tests.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -use std::{collections::HashMap, convert::TryFrom}; +use std::collections::HashMap; use parity_scale_codec::Encode; diff --git a/polkadot/node/network/availability-distribution/src/tests/mock.rs b/polkadot/node/network/availability-distribution/src/tests/mock.rs index fbd4234109..86be0a1e23 100644 --- a/polkadot/node/network/availability-distribution/src/tests/mock.rs +++ b/polkadot/node/network/availability-distribution/src/tests/mock.rs @@ -16,7 +16,7 @@ //! Helper functions and tools to generate mock data useful for testing this subsystem. -use std::{convert::TryFrom, sync::Arc}; +use std::sync::Arc; use sp_keyring::Sr25519Keyring; diff --git a/polkadot/node/network/availability-recovery/src/lib.rs b/polkadot/node/network/availability-recovery/src/lib.rs index 54971cf32b..f33ee90d82 100644 --- a/polkadot/node/network/availability-recovery/src/lib.rs +++ b/polkadot/node/network/availability-recovery/src/lib.rs @@ -20,7 +20,6 @@ use std::{ collections::{HashMap, VecDeque}, - convert::TryFrom, pin::Pin, time::Duration, }; diff --git a/polkadot/node/network/availability-recovery/src/tests.rs b/polkadot/node/network/availability-recovery/src/tests.rs index 507941fc9e..193ec27ebb 100644 --- a/polkadot/node/network/availability-recovery/src/tests.rs +++ b/polkadot/node/network/availability-recovery/src/tests.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -use std::{convert::TryFrom, sync::Arc, time::Duration}; +use std::{sync::Arc, time::Duration}; use assert_matches::assert_matches; use futures::{executor, future}; diff --git a/polkadot/node/network/protocol/src/lib.rs b/polkadot/node/network/protocol/src/lib.rs index 772149c35a..b039527440 100644 --- a/polkadot/node/network/protocol/src/lib.rs +++ b/polkadot/node/network/protocol/src/lib.rs @@ -282,7 +282,6 @@ impl View { /// v1 protocol types. pub mod v1 { use parity_scale_codec::{Decode, Encode}; - use std::convert::TryFrom; use polkadot_primitives::v2::{ CandidateHash, CandidateIndex, CollatorId, CollatorSignature, CompactStatement, Hash, diff --git a/polkadot/node/primitives/src/disputes/mod.rs b/polkadot/node/primitives/src/disputes/mod.rs index ae6c1c08cb..4b2d636dc1 100644 --- a/polkadot/node/primitives/src/disputes/mod.rs +++ b/polkadot/node/primitives/src/disputes/mod.rs @@ -14,8 +14,6 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -use std::convert::TryInto; - use parity_scale_codec::{Decode, Encode}; use sp_application_crypto::AppKey; diff --git a/polkadot/node/primitives/src/lib.rs b/polkadot/node/primitives/src/lib.rs index 9075a168f0..021d8e7374 100644 --- a/polkadot/node/primitives/src/lib.rs +++ b/polkadot/node/primitives/src/lib.rs @@ -22,7 +22,7 @@ #![deny(missing_docs)] -use std::{convert::TryFrom, pin::Pin, time::Duration}; +use std::{pin::Pin, time::Duration}; use bounded_vec::BoundedVec; use futures::Future; diff --git a/polkadot/node/subsystem-types/src/messages/network_bridge_event.rs b/polkadot/node/subsystem-types/src/messages/network_bridge_event.rs index b8fe157cbe..bcdeee1d55 100644 --- a/polkadot/node/subsystem-types/src/messages/network_bridge_event.rs +++ b/polkadot/node/subsystem-types/src/messages/network_bridge_event.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -use std::{collections::HashSet, convert::TryFrom}; +use std::collections::HashSet; pub use sc_network::{PeerId, ReputationChange}; diff --git a/polkadot/node/subsystem-util/src/lib.rs b/polkadot/node/subsystem-util/src/lib.rs index 6886d298eb..8e969fc110 100644 --- a/polkadot/node/subsystem-util/src/lib.rs +++ b/polkadot/node/subsystem-util/src/lib.rs @@ -61,7 +61,6 @@ use sp_core::{traits::SpawnNamed, ByteArray}; use sp_keystore::{CryptoStore, Error as KeystoreError, SyncCryptoStorePtr}; use std::{ collections::{hash_map::Entry, HashMap}, - convert::TryFrom, fmt, marker::Unpin, pin::Pin, diff --git a/polkadot/primitives/src/v2/signed.rs b/polkadot/primitives/src/v2/signed.rs index e58a09a0ea..28c3b79003 100644 --- a/polkadot/primitives/src/v2/signed.rs +++ b/polkadot/primitives/src/v2/signed.rs @@ -21,8 +21,6 @@ use scale_info::TypeInfo; use application_crypto::AppKey; #[cfg(feature = "std")] use sp_keystore::{CryptoStore, Error as KeystoreError, SyncCryptoStorePtr}; -#[cfg(feature = "std")] -use sp_std::convert::TryInto; use sp_std::prelude::Vec; use primitives::RuntimeDebug; diff --git a/polkadot/runtime/common/slot_range_helper/src/lib.rs b/polkadot/runtime/common/slot_range_helper/src/lib.rs index 2adb8ecaea..74f9a650bd 100644 --- a/polkadot/runtime/common/slot_range_helper/src/lib.rs +++ b/polkadot/runtime/common/slot_range_helper/src/lib.rs @@ -22,7 +22,7 @@ pub use enumn::N; pub use parity_scale_codec::{Decode, Encode}; pub use paste; pub use sp_runtime::traits::CheckedSub; -pub use sp_std::{convert::TryInto, ops::Add, result}; +pub use sp_std::{ops::Add, result}; /// This macro generates a `SlotRange` enum of arbitrary length for use in the Slot Auction /// mechanism on Polkadot. @@ -168,7 +168,7 @@ macro_rules! generate_slot_range_new_bounded { /// /// For example: `SlotRange::new_bounded(1, 2, 3) == SlotRange::OneTwo`. pub fn new_bounded< - Index: $crate::Add + $crate::CheckedSub + Copy + Ord + From + $crate::TryInto + Index: $crate::Add + $crate::CheckedSub + Copy + Ord + From + TryInto >( current: Index, first: Index, diff --git a/polkadot/runtime/common/src/crowdloan/mod.rs b/polkadot/runtime/common/src/crowdloan/mod.rs index d2eab09ba3..e41ceb15dc 100644 --- a/polkadot/runtime/common/src/crowdloan/mod.rs +++ b/polkadot/runtime/common/src/crowdloan/mod.rs @@ -826,7 +826,7 @@ mod crypto { use sp_core::ed25519; use sp_io::crypto::{ed25519_generate, ed25519_sign}; use sp_runtime::{MultiSignature, MultiSigner}; - use sp_std::{convert::TryFrom, vec::Vec}; + use sp_std::vec::Vec; pub fn create_ed25519_pubkey(seed: Vec) -> MultiSigner { ed25519_generate(0.into(), Some(seed)).into() diff --git a/polkadot/runtime/common/src/integration_tests.rs b/polkadot/runtime/common/src/integration_tests.rs index abfba2bcd9..7ff7afe4fd 100644 --- a/polkadot/runtime/common/src/integration_tests.rs +++ b/polkadot/runtime/common/src/integration_tests.rs @@ -44,7 +44,7 @@ use sp_runtime::{ transaction_validity::TransactionPriority, AccountId32, }; -use sp_std::{convert::TryInto, sync::Arc}; +use sp_std::sync::Arc; type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; diff --git a/polkadot/runtime/parachains/src/builder.rs b/polkadot/runtime/parachains/src/builder.rs index 549f1428ab..828785bd54 100644 --- a/polkadot/runtime/parachains/src/builder.rs +++ b/polkadot/runtime/parachains/src/builder.rs @@ -35,7 +35,7 @@ use sp_runtime::{ traits::{Header as HeaderT, One, TrailingZeroInput, Zero}, RuntimeAppPublic, }; -use sp_std::{collections::btree_map::BTreeMap, convert::TryInto, prelude::Vec, vec}; +use sp_std::{collections::btree_map::BTreeMap, prelude::Vec, vec}; fn mock_validation_code() -> ValidationCode { ValidationCode(vec![1, 2, 3]) diff --git a/polkadot/runtime/parachains/src/paras/mod.rs b/polkadot/runtime/parachains/src/paras/mod.rs index 4f49b6f2dd..3c5b824793 100644 --- a/polkadot/runtime/parachains/src/paras/mod.rs +++ b/polkadot/runtime/parachains/src/paras/mod.rs @@ -121,7 +121,7 @@ use sp_runtime::{ traits::{AppVerify, One}, DispatchResult, SaturatedConversion, }; -use sp_std::{cmp, convert::TryInto, mem, prelude::*}; +use sp_std::{cmp, mem, prelude::*}; #[cfg(feature = "std")] use serde::{Deserialize, Serialize}; diff --git a/polkadot/runtime/parachains/src/scheduler.rs b/polkadot/runtime/parachains/src/scheduler.rs index 9bf467f09f..7cb7497571 100644 --- a/polkadot/runtime/parachains/src/scheduler.rs +++ b/polkadot/runtime/parachains/src/scheduler.rs @@ -42,7 +42,7 @@ use primitives::v2::{ }; use scale_info::TypeInfo; use sp_runtime::traits::{One, Saturating}; -use sp_std::{convert::TryInto, prelude::*}; +use sp_std::prelude::*; use crate::{configuration, initializer::SessionChangeNotification, paras}; diff --git a/polkadot/runtime/parachains/src/ump.rs b/polkadot/runtime/parachains/src/ump.rs index 1f373a4c08..7d40a99e98 100644 --- a/polkadot/runtime/parachains/src/ump.rs +++ b/polkadot/runtime/parachains/src/ump.rs @@ -21,9 +21,7 @@ use crate::{ use frame_support::{pallet_prelude::*, traits::EnsureOrigin}; use frame_system::pallet_prelude::*; use primitives::v2::{Id as ParaId, UpwardMessage}; -use sp_std::{ - collections::btree_map::BTreeMap, convert::TryFrom, fmt, marker::PhantomData, mem, prelude::*, -}; +use sp_std::{collections::btree_map::BTreeMap, fmt, marker::PhantomData, mem, prelude::*}; use xcm::latest::Outcome; pub use pallet::*; diff --git a/polkadot/runtime/rococo/src/bridge_messages.rs b/polkadot/runtime/rococo/src/bridge_messages.rs index ca18aef814..53f5b90f5d 100644 --- a/polkadot/runtime/rococo/src/bridge_messages.rs +++ b/polkadot/runtime/rococo/src/bridge_messages.rs @@ -39,7 +39,7 @@ use frame_support::{ }; use rococo_runtime_constants::fee::WeightToFee; use sp_runtime::FixedU128; -use sp_std::{convert::TryFrom, marker::PhantomData, ops::RangeInclusive}; +use sp_std::{marker::PhantomData, ops::RangeInclusive}; /// Maximal number of pending outbound messages. const MAXIMAL_PENDING_MESSAGES_AT_OUTBOUND_LANE: MessageNonce = diff --git a/polkadot/runtime/test-runtime/src/lib.rs b/polkadot/runtime/test-runtime/src/lib.rs index 8adf4a54ea..04bf929c46 100644 --- a/polkadot/runtime/test-runtime/src/lib.rs +++ b/polkadot/runtime/test-runtime/src/lib.rs @@ -850,7 +850,6 @@ sp_api::impl_runtime_apis! { } fn candidate_events() -> Vec> { - use core::convert::TryInto; runtime_impl::candidate_events::(|trait_event| trait_event.try_into().ok()) } diff --git a/polkadot/tests/purge_chain_works.rs b/polkadot/tests/purge_chain_works.rs index 94f256c571..d0a12c1b6e 100644 --- a/polkadot/tests/purge_chain_works.rs +++ b/polkadot/tests/purge_chain_works.rs @@ -15,7 +15,7 @@ // along with Substrate. If not, see . use assert_cmd::cargo::cargo_bin; -use std::{convert::TryInto, process::Command, time::Duration}; +use std::{process::Command, time::Duration}; use tempfile::tempdir; pub mod common; diff --git a/polkadot/tests/running_the_node_and_interrupt.rs b/polkadot/tests/running_the_node_and_interrupt.rs index 1eb7d78a52..a27f13fcba 100644 --- a/polkadot/tests/running_the_node_and_interrupt.rs +++ b/polkadot/tests/running_the_node_and_interrupt.rs @@ -15,7 +15,7 @@ // along with Substrate. If not, see . use assert_cmd::cargo::cargo_bin; -use std::{convert::TryInto, process::Command, time::Duration}; +use std::{process::Command, time::Duration}; use tempfile::tempdir; pub mod common; diff --git a/polkadot/utils/remote-ext-tests/bags-list/src/main.rs b/polkadot/utils/remote-ext-tests/bags-list/src/main.rs index 37582da429..2c0bc6aeac 100644 --- a/polkadot/utils/remote-ext-tests/bags-list/src/main.rs +++ b/polkadot/utils/remote-ext-tests/bags-list/src/main.rs @@ -17,7 +17,6 @@ //! Remote tests for bags-list pallet. use clap::{ArgEnum, Parser}; -use std::convert::TryInto; #[derive(Clone, Debug, ArgEnum)] #[clap(rename_all = "PascalCase")] diff --git a/polkadot/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs b/polkadot/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs index 53ca6dd3a0..d97ac34b26 100644 --- a/polkadot/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs +++ b/polkadot/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs @@ -22,7 +22,7 @@ use frame_support::{ traits::fungible::{Inspect, Mutate}, }; use sp_runtime::traits::{Bounded, Zero}; -use sp_std::{convert::TryInto, prelude::*, vec}; +use sp_std::{prelude::*, vec}; use xcm::latest::prelude::*; use xcm_executor::traits::{Convert, TransactAsset}; diff --git a/polkadot/xcm/pallet-xcm/src/lib.rs b/polkadot/xcm/pallet-xcm/src/lib.rs index 84669fa602..9fe7f72d42 100644 --- a/polkadot/xcm/pallet-xcm/src/lib.rs +++ b/polkadot/xcm/pallet-xcm/src/lib.rs @@ -30,14 +30,7 @@ use sp_runtime::{ traits::{BadOrigin, Saturating}, RuntimeDebug, }; -use sp_std::{ - boxed::Box, - convert::{TryFrom, TryInto}, - marker::PhantomData, - prelude::*, - result::Result, - vec, -}; +use sp_std::{boxed::Box, marker::PhantomData, prelude::*, result::Result, vec}; use xcm::prelude::*; use xcm_executor::traits::ConvertOrigin; diff --git a/polkadot/xcm/pallet-xcm/src/tests.rs b/polkadot/xcm/pallet-xcm/src/tests.rs index 660ac0ef14..b61f61e436 100644 --- a/polkadot/xcm/pallet-xcm/src/tests.rs +++ b/polkadot/xcm/pallet-xcm/src/tests.rs @@ -24,7 +24,6 @@ use frame_support::{ }; use polkadot_parachain::primitives::{AccountIdConversion, Id as ParaId}; use sp_runtime::traits::{BlakeTwo256, Hash}; -use std::convert::TryInto; use xcm::prelude::*; use xcm_builder::AllowKnownQueryResponses; use xcm_executor::{traits::ShouldExecute, XcmExecutor}; diff --git a/polkadot/xcm/procedural/src/v0/multilocation.rs b/polkadot/xcm/procedural/src/v0/multilocation.rs index 247ef856b1..82db5cce4e 100644 --- a/polkadot/xcm/procedural/src/v0/multilocation.rs +++ b/polkadot/xcm/procedural/src/v0/multilocation.rs @@ -96,7 +96,7 @@ fn generate_conversion_from_v1() -> TokenStream { .collect::(); quote! { - impl core::convert::TryFrom for MultiLocation { + impl TryFrom for MultiLocation { type Error = (); fn try_from(v1: crate::v1::MultiLocation) -> core::result::Result { let mut res = MultiLocation::Null; diff --git a/polkadot/xcm/procedural/src/v1/multilocation.rs b/polkadot/xcm/procedural/src/v1/multilocation.rs index eae3d677b0..0d8ab5452b 100644 --- a/polkadot/xcm/procedural/src/v1/multilocation.rs +++ b/polkadot/xcm/procedural/src/v1/multilocation.rs @@ -172,7 +172,7 @@ fn generate_conversion_from_v0() -> TokenStream { if #( #parent_idents.is_parent() )&&* => Ok(MultiLocation { parents: #parent_count, - interior: #junction_variant( #( core::convert::TryInto::try_into(#junction_idents)? ),* ), + interior: #junction_variant( #( TryInto::try_into(#junction_idents)? ),* ), }), } }) @@ -184,7 +184,7 @@ fn generate_conversion_from_v0() -> TokenStream { Ok(MultiLocation::ancestor(#num_ancestors)), #intermediate_match_arms crate::v0::MultiLocation::#variant( #(#idents),* ) => - Ok( #variant( #( core::convert::TryInto::try_into(#idents)? ),* ).into() ), + Ok( #variant( #( TryInto::try_into(#idents)? ),* ).into() ), } }) .collect::(); diff --git a/polkadot/xcm/src/lib.rs b/polkadot/xcm/src/lib.rs index 87aad30c79..37157f2c34 100644 --- a/polkadot/xcm/src/lib.rs +++ b/polkadot/xcm/src/lib.rs @@ -24,10 +24,6 @@ extern crate alloc; use alloc::vec::Vec; -use core::{ - convert::{TryFrom, TryInto}, - result::Result, -}; use derivative::Derivative; use parity_scale_codec::{Decode, Encode, Error as CodecError, Input}; use scale_info::TypeInfo; diff --git a/polkadot/xcm/src/v0/mod.rs b/polkadot/xcm/src/v0/mod.rs index 35889d8daa..08db57c2e0 100644 --- a/polkadot/xcm/src/v0/mod.rs +++ b/polkadot/xcm/src/v0/mod.rs @@ -18,10 +18,7 @@ use crate::DoubleEncoded; use alloc::vec::Vec; -use core::{ - convert::{TryFrom, TryInto}, - result, -}; +use core::result; use derivative::Derivative; use parity_scale_codec::{self, Decode, Encode}; use scale_info::TypeInfo; diff --git a/polkadot/xcm/src/v0/multi_asset.rs b/polkadot/xcm/src/v0/multi_asset.rs index dac5a6bfeb..d8ad4ab8c2 100644 --- a/polkadot/xcm/src/v0/multi_asset.rs +++ b/polkadot/xcm/src/v0/multi_asset.rs @@ -19,10 +19,7 @@ use super::MultiLocation; use crate::v1::{MultiAssetFilter, MultiAssets, WildMultiAsset}; use alloc::{vec, vec::Vec}; -use core::{ - convert::{TryFrom, TryInto}, - result, -}; +use core::result; use parity_scale_codec::{self, Decode, Encode}; use scale_info::TypeInfo; diff --git a/polkadot/xcm/src/v0/multi_location.rs b/polkadot/xcm/src/v0/multi_location.rs index 6b7438b93f..0491e27d64 100644 --- a/polkadot/xcm/src/v0/multi_location.rs +++ b/polkadot/xcm/src/v0/multi_location.rs @@ -694,7 +694,6 @@ mod tests { #[test] fn conversion_from_other_types_works() { use crate::v1::{self, Junction, Junctions}; - use core::convert::TryInto; fn takes_multilocation>(_arg: Arg) {} diff --git a/polkadot/xcm/src/v0/order.rs b/polkadot/xcm/src/v0/order.rs index 54117e31f9..c55a61f6ff 100644 --- a/polkadot/xcm/src/v0/order.rs +++ b/polkadot/xcm/src/v0/order.rs @@ -18,10 +18,7 @@ use super::{super::v1::Order as Order1, MultiAsset, MultiLocation, Xcm}; use alloc::vec::Vec; -use core::{ - convert::{TryFrom, TryInto}, - result, -}; +use core::result; use derivative::Derivative; use parity_scale_codec::{self, Decode, Encode}; diff --git a/polkadot/xcm/src/v1/junction.rs b/polkadot/xcm/src/v1/junction.rs index c4835d60c5..6e0678f76c 100644 --- a/polkadot/xcm/src/v1/junction.rs +++ b/polkadot/xcm/src/v1/junction.rs @@ -19,7 +19,6 @@ use super::{BodyId, BodyPart, Junctions, MultiLocation, NetworkId}; use crate::v0::Junction as Junction0; use alloc::vec::Vec; -use core::convert::TryFrom; use parity_scale_codec::{self, Decode, Encode}; use scale_info::TypeInfo; diff --git a/polkadot/xcm/src/v1/mod.rs b/polkadot/xcm/src/v1/mod.rs index 87c0164320..83b1124904 100644 --- a/polkadot/xcm/src/v1/mod.rs +++ b/polkadot/xcm/src/v1/mod.rs @@ -66,11 +66,7 @@ use super::{ }; use crate::DoubleEncoded; use alloc::vec::Vec; -use core::{ - convert::{TryFrom, TryInto}, - fmt::Debug, - result, -}; +use core::{fmt::Debug, result}; use derivative::Derivative; use parity_scale_codec::{self, Decode, Encode}; use scale_info::TypeInfo; diff --git a/polkadot/xcm/src/v1/multiasset.rs b/polkadot/xcm/src/v1/multiasset.rs index f07819aa17..10e49af8d2 100644 --- a/polkadot/xcm/src/v1/multiasset.rs +++ b/polkadot/xcm/src/v1/multiasset.rs @@ -25,11 +25,7 @@ use super::MultiLocation; use alloc::{vec, vec::Vec}; -use core::{ - cmp::Ordering, - convert::{TryFrom, TryInto}, - result, -}; +use core::{cmp::Ordering, result}; use parity_scale_codec::{self as codec, Decode, Encode}; use scale_info::TypeInfo; diff --git a/polkadot/xcm/src/v1/multilocation.rs b/polkadot/xcm/src/v1/multilocation.rs index 12b5073292..073d37ba48 100644 --- a/polkadot/xcm/src/v1/multilocation.rs +++ b/polkadot/xcm/src/v1/multilocation.rs @@ -17,7 +17,7 @@ //! Cross-Consensus Message format data structures. use super::Junction; -use core::{convert::TryFrom, mem, result}; +use core::{mem, result}; use parity_scale_codec::{Decode, Encode}; use scale_info::TypeInfo; @@ -1011,7 +1011,6 @@ mod tests { #[test] fn conversion_from_other_types_works() { use crate::v0; - use core::convert::TryInto; fn takes_multilocation>(_arg: Arg) {} diff --git a/polkadot/xcm/src/v1/order.rs b/polkadot/xcm/src/v1/order.rs index 00ee69458c..f97e56f653 100644 --- a/polkadot/xcm/src/v1/order.rs +++ b/polkadot/xcm/src/v1/order.rs @@ -19,10 +19,7 @@ use super::{MultiAsset, MultiAssetFilter, MultiAssets, MultiLocation, Xcm}; use crate::{v0::Order as OldOrder, v2::Instruction}; use alloc::{vec, vec::Vec}; -use core::{ - convert::{TryFrom, TryInto}, - result, -}; +use core::result; use derivative::Derivative; use parity_scale_codec::{self, Decode, Encode}; use scale_info::TypeInfo; diff --git a/polkadot/xcm/src/v2/mod.rs b/polkadot/xcm/src/v2/mod.rs index 26efd0228c..94e9ddf381 100644 --- a/polkadot/xcm/src/v2/mod.rs +++ b/polkadot/xcm/src/v2/mod.rs @@ -53,11 +53,7 @@ use super::v1::{Order as OldOrder, Response as OldResponse, Xcm as OldXcm}; use crate::{DoubleEncoded, GetWeight}; use alloc::{vec, vec::Vec}; -use core::{ - convert::{TryFrom, TryInto}, - fmt::Debug, - result, -}; +use core::{fmt::Debug, result}; use derivative::Derivative; use parity_scale_codec::{self, Decode, Encode}; use scale_info::TypeInfo; diff --git a/polkadot/xcm/xcm-builder/src/matches_fungible.rs b/polkadot/xcm/xcm-builder/src/matches_fungible.rs index 6c33e18fe9..e4092500be 100644 --- a/polkadot/xcm/xcm-builder/src/matches_fungible.rs +++ b/polkadot/xcm/xcm-builder/src/matches_fungible.rs @@ -18,7 +18,7 @@ use frame_support::traits::Get; use sp_runtime::traits::CheckedConversion; -use sp_std::{convert::TryFrom, marker::PhantomData}; +use sp_std::marker::PhantomData; use xcm::latest::{ AssetId::{Abstract, Concrete}, Fungibility::Fungible, diff --git a/polkadot/xcm/xcm-builder/src/origin_conversion.rs b/polkadot/xcm/xcm-builder/src/origin_conversion.rs index b42c8fcff9..4d9a882464 100644 --- a/polkadot/xcm/xcm-builder/src/origin_conversion.rs +++ b/polkadot/xcm/xcm-builder/src/origin_conversion.rs @@ -19,7 +19,7 @@ use frame_support::traits::{EnsureOrigin, Get, GetBacking, OriginTrait}; use frame_system::RawOrigin as SystemRawOrigin; use polkadot_parachain::primitives::IsSystem; -use sp_std::{convert::TryInto, marker::PhantomData}; +use sp_std::marker::PhantomData; use xcm::latest::{BodyId, BodyPart, Junction, Junctions::*, MultiLocation, NetworkId, OriginKind}; use xcm_executor::traits::{Convert, ConvertOrigin}; diff --git a/polkadot/xcm/xcm-builder/src/weight.rs b/polkadot/xcm/xcm-builder/src/weight.rs index 755b6acf28..3d161dbf7a 100644 --- a/polkadot/xcm/xcm-builder/src/weight.rs +++ b/polkadot/xcm/xcm-builder/src/weight.rs @@ -20,7 +20,7 @@ use frame_support::{ }; use parity_scale_codec::Decode; use sp_runtime::traits::{SaturatedConversion, Saturating, Zero}; -use sp_std::{convert::TryInto, marker::PhantomData, result::Result}; +use sp_std::{marker::PhantomData, result::Result}; use xcm::latest::prelude::*; use xcm_executor::{ traits::{WeightBounds, WeightTrader}, diff --git a/polkadot/xcm/xcm-executor/src/traits/conversion.rs b/polkadot/xcm/xcm-executor/src/traits/conversion.rs index d8c5003766..8ea91b598e 100644 --- a/polkadot/xcm/xcm-executor/src/traits/conversion.rs +++ b/polkadot/xcm/xcm-executor/src/traits/conversion.rs @@ -15,7 +15,7 @@ // along with Polkadot. If not, see . use parity_scale_codec::{Decode, Encode}; -use sp_std::{borrow::Borrow, convert::TryFrom, prelude::*, result::Result}; +use sp_std::{borrow::Borrow, prelude::*, result::Result}; use xcm::latest::{MultiLocation, OriginKind}; /// Generic third-party conversion trait. Use this when you don't want to force the user to use default diff --git a/polkadot/xcm/xcm-simulator/example/src/parachain.rs b/polkadot/xcm/xcm-simulator/example/src/parachain.rs index 5bde85e39f..614d50e4fc 100644 --- a/polkadot/xcm/xcm-simulator/example/src/parachain.rs +++ b/polkadot/xcm/xcm-simulator/example/src/parachain.rs @@ -28,7 +28,7 @@ use sp_runtime::{ traits::{Hash, IdentityLookup}, AccountId32, }; -use sp_std::{convert::TryFrom, prelude::*}; +use sp_std::prelude::*; use pallet_xcm::XcmPassthrough; use polkadot_core_primitives::BlockNumber as RelayBlockNumber; diff --git a/polkadot/xcm/xcm-simulator/fuzzer/src/parachain.rs b/polkadot/xcm/xcm-simulator/fuzzer/src/parachain.rs index bfc7e4858a..3326875206 100644 --- a/polkadot/xcm/xcm-simulator/fuzzer/src/parachain.rs +++ b/polkadot/xcm/xcm-simulator/fuzzer/src/parachain.rs @@ -28,7 +28,7 @@ use sp_runtime::{ traits::{Hash, IdentityLookup}, AccountId32, }; -use sp_std::{convert::TryFrom, prelude::*}; +use sp_std::prelude::*; use pallet_xcm::XcmPassthrough; use polkadot_core_primitives::BlockNumber as RelayBlockNumber;