Fix clippy warnings (#2861)

Fix some issues reported by clippy
This commit is contained in:
Tsvetomir Dimitrov
2024-01-05 21:31:56 +02:00
committed by GitHub
parent 1c95310a66
commit cea7024de1
11 changed files with 8 additions and 16 deletions
@@ -110,7 +110,7 @@ fn process_message_fails_on_max_nonce_reached() {
channel_id,
command: mock_message(sibling_id).command,
};
let versioned_queued_message: VersionedQueuedMessage = message.try_into().unwrap();
let versioned_queued_message: VersionedQueuedMessage = message.into();
let encoded = versioned_queued_message.encode();
let mut meter = WeightMeter::with_limit(Weight::MAX);
@@ -134,7 +134,7 @@ fn process_message_fails_on_overweight_message() {
channel_id,
command: mock_message(sibling_id).command,
};
let versioned_queued_message: VersionedQueuedMessage = message.try_into().unwrap();
let versioned_queued_message: VersionedQueuedMessage = message.into();
let encoded = versioned_queued_message.encode();
let mut meter = WeightMeter::with_limit(Weight::from_parts(1, 1));
assert_noop!(
@@ -79,8 +79,6 @@ use xcm_executor::traits::ConvertLocation;
#[cfg(feature = "runtime-benchmarks")]
use frame_support::traits::OriginTrait;
pub use pallet::*;
pub type BalanceOf<T> =
<<T as pallet::Config>::Token as Inspect<<T as frame_system::Config>::AccountId>>::Balance;
pub type AccountIdOf<T> = <T as frame_system::Config>::AccountId;
@@ -12,11 +12,11 @@ use parachains_runtimes_test_utils::{
};
use sp_core::H160;
use sp_runtime::SaturatedConversion;
use xcm::latest::prelude::*;
use xcm::{
latest::prelude::*,
v3::Error::{self, Barrier},
};
use xcm_executor::XcmExecutor;
// Re-export test_case from `parachains-runtimes-test-utils`
pub use parachains_runtimes_test_utils::test_cases::change_storage_constant_by_governance_works;
use xcm::v3::Error::{self, Barrier};
type RuntimeHelper<Runtime, AllPalletsWithoutSystem = ()> =
parachains_runtimes_test_utils::RuntimeHelper<Runtime, AllPalletsWithoutSystem>;
@@ -88,7 +88,7 @@ impl Identity {
};
let (github, discord) = additional
.as_ref()
.and_then(|vec| vec.get(0))
.and_then(|vec| vec.first())
.map(|(g, d)| (g.clone(), d.clone()))
.unwrap_or((Data::None, Data::None));
Self {
@@ -88,7 +88,7 @@ impl Identity {
};
let (github, discord) = additional
.as_ref()
.and_then(|vec| vec.get(0))
.and_then(|vec| vec.first())
.map(|(g, d)| (g.clone(), d.clone()))
.unwrap_or((Data::None, Data::None));
Self {
@@ -37,5 +37,4 @@ pub mod xcm;
pub use block_weights::constants::BlockExecutionWeight;
pub use extrinsic_weights::constants::ExtrinsicBaseWeight;
pub use paritydb_weights::constants::ParityDbWeight;
pub use rocksdb_weights::constants::RocksDbWeight;
@@ -36,5 +36,4 @@ pub mod xcm;
pub use block_weights::constants::BlockExecutionWeight;
pub use extrinsic_weights::constants::ExtrinsicBaseWeight;
pub use paritydb_weights::constants::ParityDbWeight;
pub use rocksdb_weights::constants::RocksDbWeight;
@@ -36,5 +36,4 @@ pub mod xcm;
pub use block_weights::constants::BlockExecutionWeight;
pub use extrinsic_weights::constants::ExtrinsicBaseWeight;
pub use paritydb_weights::constants::ParityDbWeight;
pub use rocksdb_weights::constants::RocksDbWeight;
@@ -36,5 +36,4 @@ pub mod xcm;
pub use block_weights::constants::BlockExecutionWeight;
pub use extrinsic_weights::constants::ExtrinsicBaseWeight;
pub use paritydb_weights::constants::ParityDbWeight;
pub use rocksdb_weights::constants::RocksDbWeight;
@@ -14,7 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
pub use sp_core::sr25519;
use sp_core::{
sr25519::{Pair, Public},
Pair as PairT,
@@ -23,7 +23,6 @@ pub mod network_bridge;
pub mod runtime_api;
pub use av_store::*;
pub use network_bridge::*;
pub use runtime_api::*;
pub struct AlwaysSupportsParachains {}