diff --git a/bridges/bin/millau/runtime/src/lib.rs b/bridges/bin/millau/runtime/src/lib.rs index 7a4bcae9668fb..8217967020768 100644 --- a/bridges/bin/millau/runtime/src/lib.rs +++ b/bridges/bin/millau/runtime/src/lib.rs @@ -23,6 +23,8 @@ #![allow(clippy::large_enum_variant)] // Runtime-generated DecodeLimit::decode_all_With_depth_limit #![allow(clippy::unnecessary_mut_passed)] +// From construct_runtime macro +#![allow(clippy::from_over_into)] // Make the WASM binary available. #[cfg(feature = "std")] diff --git a/bridges/bin/rialto/runtime/src/lib.rs b/bridges/bin/rialto/runtime/src/lib.rs index fc6ae5b01b4b7..4881dea298298 100644 --- a/bridges/bin/rialto/runtime/src/lib.rs +++ b/bridges/bin/rialto/runtime/src/lib.rs @@ -23,6 +23,8 @@ #![allow(clippy::large_enum_variant)] // Runtime-generated DecodeLimit::decode_all_With_depth_limit #![allow(clippy::unnecessary_mut_passed)] +// From construct_runtime macro +#![allow(clippy::from_over_into)] // Make the WASM binary available. #[cfg(feature = "std")] diff --git a/bridges/modules/call-dispatch/src/lib.rs b/bridges/modules/call-dispatch/src/lib.rs index 5eeca178d1484..7f41322455455 100644 --- a/bridges/modules/call-dispatch/src/lib.rs +++ b/bridges/modules/call-dispatch/src/lib.rs @@ -394,6 +394,9 @@ where #[cfg(test)] mod tests { + // From construct_runtime macro + #![allow(clippy::from_over_into)] + use super::*; use frame_support::{parameter_types, weights::Weight}; use frame_system::{EventRecord, Phase}; diff --git a/bridges/modules/currency-exchange/src/lib.rs b/bridges/modules/currency-exchange/src/lib.rs index 9d1eb9f4489ba..7c7d7e4a4d0fc 100644 --- a/bridges/modules/currency-exchange/src/lib.rs +++ b/bridges/modules/currency-exchange/src/lib.rs @@ -210,6 +210,9 @@ fn prepare_deposit_details, I: Instance>( #[cfg(test)] mod tests { + // From construct_runtime macro + #![allow(clippy::from_over_into)] + use super::*; use bp_currency_exchange::LockFundsTransaction; use frame_support::{assert_noop, assert_ok, construct_runtime, parameter_types, weights::Weight}; diff --git a/bridges/modules/ethereum-contract/builtin/src/lib.rs b/bridges/modules/ethereum-contract/builtin/src/lib.rs index abb7375103dff..5762d510b2a90 100644 --- a/bridges/modules/ethereum-contract/builtin/src/lib.rs +++ b/bridges/modules/ethereum-contract/builtin/src/lib.rs @@ -85,7 +85,7 @@ pub fn from_substrate_block_number(number: BlockNumber) -> Result { /// Parse Substrate header. pub fn parse_substrate_header(raw_header: &[u8]) -> Result { - let substrate_header = RuntimeHeader::decode(&mut &raw_header[..]) + let substrate_header = RuntimeHeader::decode(&mut &*raw_header) .map(|header| Header { hash: header.hash(), parent_hash: header.parent_hash, @@ -100,7 +100,7 @@ pub fn parse_substrate_header(raw_header: &[u8]) -> Result { } }) }) - .and_then(|log| ConsensusLog::decode(&mut &log[..]).ok()) + .and_then(|log| ConsensusLog::decode(&mut &*log).ok()) .and_then(|log| match log { ConsensusLog::ScheduledChange(scheduled_change) => Some(ValidatorsSetSignal { delay: scheduled_change.delay, @@ -133,7 +133,7 @@ pub fn verify_substrate_finality_proof( raw_best_set: &[u8], raw_finality_proof: &[u8], ) -> Result<(), Error> { - let best_set = AuthorityList::decode(&mut &raw_best_set[..]) + let best_set = AuthorityList::decode(&mut &*raw_best_set) .map_err(Error::BestSetDecode) .and_then(|authorities| VoterSet::new(authorities.into_iter()).ok_or(Error::InvalidBestSet)); diff --git a/bridges/modules/ethereum/src/mock.rs b/bridges/modules/ethereum/src/mock.rs index bf5fc54da6e74..6808062d4d0c3 100644 --- a/bridges/modules/ethereum/src/mock.rs +++ b/bridges/modules/ethereum/src/mock.rs @@ -14,6 +14,9 @@ // You should have received a copy of the GNU General Public License // along with Parity Bridges Common. If not, see . +// From construct_runtime macro +#![allow(clippy::from_over_into)] + pub use crate::test_utils::{insert_header, validator_utils::*, validators_change_receipt, HeaderBuilder, GAS_LIMIT}; pub use bp_eth_poa::signatures::secret_to_address; diff --git a/bridges/modules/finality-verifier/src/mock.rs b/bridges/modules/finality-verifier/src/mock.rs index b78cce664ba98..26890d9d23a1f 100644 --- a/bridges/modules/finality-verifier/src/mock.rs +++ b/bridges/modules/finality-verifier/src/mock.rs @@ -14,6 +14,9 @@ // You should have received a copy of the GNU General Public License // along with Parity Bridges Common. If not, see . +// From construct_runtime macro +#![allow(clippy::from_over_into)] + use crate::pallet::{BridgedHeader, Config}; use bp_runtime::{BlockNumberOf, Chain}; use frame_support::{construct_runtime, parameter_types, weights::Weight}; diff --git a/bridges/modules/message-lane/src/mock.rs b/bridges/modules/message-lane/src/mock.rs index 340360a126806..948c107d0518b 100644 --- a/bridges/modules/message-lane/src/mock.rs +++ b/bridges/modules/message-lane/src/mock.rs @@ -14,6 +14,9 @@ // You should have received a copy of the GNU General Public License // along with Parity Bridges Common. If not, see . +// From construct_runtime macro +#![allow(clippy::from_over_into)] + use crate::Config; use bp_message_lane::{ diff --git a/bridges/modules/shift-session-manager/src/lib.rs b/bridges/modules/shift-session-manager/src/lib.rs index ef96fc5318c1d..6fc92d73eceb2 100644 --- a/bridges/modules/shift-session-manager/src/lib.rs +++ b/bridges/modules/shift-session-manager/src/lib.rs @@ -86,6 +86,9 @@ impl Module { #[cfg(test)] mod tests { + // From construct_runtime macro + #![allow(clippy::from_over_into)] + use super::*; use frame_support::sp_io::TestExternalities; use frame_support::sp_runtime::{ diff --git a/bridges/modules/substrate/src/mock.rs b/bridges/modules/substrate/src/mock.rs index c13c466c3a810..85782b7ea4fe1 100644 --- a/bridges/modules/substrate/src/mock.rs +++ b/bridges/modules/substrate/src/mock.rs @@ -19,6 +19,8 @@ //! Includes some useful testing types and functions. #![cfg(test)] +// From construct_runtime macro +#![allow(clippy::from_over_into)] use crate::{BridgedBlockHash, BridgedBlockNumber, BridgedHeader, Config}; use bp_runtime::Chain; diff --git a/bridges/primitives/header-chain/src/justification.rs b/bridges/primitives/header-chain/src/justification.rs index 3e4b9043c08a5..929ef17bdca2e 100644 --- a/bridges/primitives/header-chain/src/justification.rs +++ b/bridges/primitives/header-chain/src/justification.rs @@ -48,7 +48,7 @@ pub enum Error { pub fn decode_justification_target( raw_justification: &[u8], ) -> Result<(Header::Hash, Header::Number), Error> { - GrandpaJustification::
::decode(&mut &raw_justification[..]) + GrandpaJustification::
::decode(&mut &*raw_justification) .map(|justification| (justification.commit.target_hash, justification.commit.target_number)) .map_err(|_| Error::JustificationDecode) } @@ -65,7 +65,7 @@ where { // Decode justification first let justification = - GrandpaJustification::
::decode(&mut &raw_justification[..]).map_err(|_| Error::JustificationDecode)?; + GrandpaJustification::
::decode(&mut &*raw_justification).map_err(|_| Error::JustificationDecode)?; // Ensure that it is justification for the expected header if (justification.commit.target_hash, justification.commit.target_number) != finalized_target { diff --git a/bridges/relays/ethereum-client/src/error.rs b/bridges/relays/ethereum-client/src/error.rs index afcc3c678254e..0f47891138aba 100644 --- a/bridges/relays/ethereum-client/src/error.rs +++ b/bridges/relays/ethereum-client/src/error.rs @@ -57,8 +57,7 @@ impl MaybeConnectionError for Error { fn is_connection_error(&self) -> bool { matches!( *self, - Error::Request(RequestError::TransportError(_)) - | Error::ClientNotSynced(_), + Error::Request(RequestError::TransportError(_)) | Error::ClientNotSynced(_), ) } } diff --git a/bridges/relays/ethereum/src/main.rs b/bridges/relays/ethereum/src/main.rs index 1dd5dd0442aa0..b75c0f44bb856 100644 --- a/bridges/relays/ethereum/src/main.rs +++ b/bridges/relays/ethereum/src/main.rs @@ -63,7 +63,6 @@ fn main() { .is_err() { log::error!(target: "bridge", "Unable to get Substrate genesis block for Ethereum sync."); - return; }; } ("sub-to-eth", Some(sub_to_eth_matches)) => { @@ -78,7 +77,6 @@ fn main() { .is_err() { log::error!(target: "bridge", "Unable to get Substrate genesis block for Substrate sync."); - return; }; } ("eth-deploy-contract", Some(eth_deploy_matches)) => { diff --git a/bridges/relays/substrate-client/src/error.rs b/bridges/relays/substrate-client/src/error.rs index f5bb250d9fb47..67aefe9885534 100644 --- a/bridges/relays/substrate-client/src/error.rs +++ b/bridges/relays/substrate-client/src/error.rs @@ -61,8 +61,7 @@ impl MaybeConnectionError for Error { fn is_connection_error(&self) -> bool { matches!( *self, - Error::Request(RequestError::TransportError(_)) - | Error::ClientNotSynced(_) + Error::Request(RequestError::TransportError(_)) | Error::ClientNotSynced(_) ) } }