diff --git a/target_chains/ethereum/sdk/stylus/contracts/src/lib.rs b/target_chains/ethereum/sdk/stylus/contracts/src/lib.rs index e9ba86fa6..ba4ad6860 100644 --- a/target_chains/ethereum/sdk/stylus/contracts/src/lib.rs +++ b/target_chains/ethereum/sdk/stylus/contracts/src/lib.rs @@ -2,7 +2,7 @@ #![allow(clippy::pub_underscore_fields, clippy::module_name_repetitions)] #![cfg_attr(not(feature = "std"), no_std, no_main)] #![deny(rustdoc::broken_intra_doc_links)] - +#![allow(clippy::let_unit_value)] extern crate alloc; #[global_allocator] diff --git a/target_chains/ethereum/sdk/stylus/contracts/src/pyth/functions.rs b/target_chains/ethereum/sdk/stylus/contracts/src/pyth/functions.rs index 7c8d2b242..0cfb2d6e5 100644 --- a/target_chains/ethereum/sdk/stylus/contracts/src/pyth/functions.rs +++ b/target_chains/ethereum/sdk/stylus/contracts/src/pyth/functions.rs @@ -1,3 +1,4 @@ +#![allow(clippy::too_many_arguments)] use crate::pyth::mock::DecodeDataType; use crate::pyth::types::{ getEmaPriceNoOlderThanCall, getEmaPriceUnsafeCall, getPriceNoOlderThanCall, getPriceUnsafeCall, @@ -272,5 +273,5 @@ pub fn create_price_feed_update_data( }; let price_feed_data_encoding = (price_feed_data, prev_publish_time); - return DecodeDataType::abi_encode(&price_feed_data_encoding); + DecodeDataType::abi_encode(&price_feed_data_encoding) } diff --git a/target_chains/ethereum/sdk/stylus/contracts/src/pyth/mock.rs b/target_chains/ethereum/sdk/stylus/contracts/src/pyth/mock.rs index 3cf258bd7..bdf94521c 100644 --- a/target_chains/ethereum/sdk/stylus/contracts/src/pyth/mock.rs +++ b/target_chains/ethereum/sdk/stylus/contracts/src/pyth/mock.rs @@ -1,3 +1,5 @@ +#![allow(clippy::clone_on_copy)] +#![allow(clippy::too_many_arguments)] use crate::pyth::errors::{Error, PriceFeedNotFound}; use crate::pyth::events::PriceFeedUpdate; use crate::pyth::functions::create_price_feed_update_data; @@ -11,7 +13,7 @@ use alloy_primitives::{Bytes, B256, U256}; use alloy_sol_types::{sol_data::Uint as SolUInt, SolType, SolValue}; use stylus_sdk::{abi::Bytes as AbiBytes, evm, msg, prelude::*}; -////Decode data type PriceFeed and uint64 +/// Decode data type PriceFeed and uint64 pub type DecodeDataType = (PriceFeed, SolUInt<64>); sol_storage! { @@ -169,7 +171,7 @@ impl MockPythContract { }; let price_feed_data_encoding = (price_feed_data, prev_publish_time); - return DecodeDataType::abi_encode(&price_feed_data_encoding); + DecodeDataType::abi_encode(&price_feed_data_encoding) } } @@ -248,12 +250,12 @@ pub fn create_price_feed_update_data_list() -> (Vec, Vec) { .update(x.as_bytes()) .finalize() .to_vec(); - return B256::from_slice(&x); + B256::from_slice(&x) }); let mut price_feed_data_list = Vec::new(); - for i in 0..3 { + for item in &id { let price_feed_data = create_price_feed_update_data( - id[i], + *item, 100, 100, 100, @@ -265,7 +267,7 @@ pub fn create_price_feed_update_data_list() -> (Vec, Vec) { let price_feed_data = Bytes::from(AbiBytes::from(price_feed_data).0); price_feed_data_list.push(price_feed_data); } - return (price_feed_data_list, id.to_vec()); + (price_feed_data_list, id.to_vec()) } #[cfg(all(test, feature = "std"))] diff --git a/target_chains/ethereum/sdk/stylus/examples/function-example/src/lib.rs b/target_chains/ethereum/sdk/stylus/examples/function-example/src/lib.rs index 559b05ce5..4fb36afe7 100644 --- a/target_chains/ethereum/sdk/stylus/examples/function-example/src/lib.rs +++ b/target_chains/ethereum/sdk/stylus/examples/function-example/src/lib.rs @@ -1,4 +1,5 @@ #![cfg_attr(not(test), no_std, no_main)] +#![allow(clippy::let_unit_value)] extern crate alloc; use alloc::vec; diff --git a/target_chains/ethereum/sdk/stylus/examples/pyth-example/src/lib.rs b/target_chains/ethereum/sdk/stylus/examples/pyth-example/src/lib.rs index 30a8b96a9..088571000 100644 --- a/target_chains/ethereum/sdk/stylus/examples/pyth-example/src/lib.rs +++ b/target_chains/ethereum/sdk/stylus/examples/pyth-example/src/lib.rs @@ -10,7 +10,7 @@ use pyth_stylus::pyth::{ use stylus_sdk::{abi::Bytes, alloy_primitives::U256, msg, prelude::*, stylus_proc::SolidityError}; pub use sol::*; -#[cfg_attr(coverage_nightly, coverage(off))] + mod sol { use alloy_sol_types::sol;