Skip to content

Commit 996f398

Browse files
chore: pre-commit run --all
1 parent 4380ef4 commit 996f398

File tree

5 files changed

+13
-9
lines changed

5 files changed

+13
-9
lines changed

target_chains/ethereum/sdk/stylus/contracts/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#![allow(clippy::pub_underscore_fields, clippy::module_name_repetitions)]
33
#![cfg_attr(not(feature = "std"), no_std, no_main)]
44
#![deny(rustdoc::broken_intra_doc_links)]
5-
5+
#![allow(clippy::let_unit_value)]
66
extern crate alloc;
77

88
#[global_allocator]

target_chains/ethereum/sdk/stylus/contracts/src/pyth/functions.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(clippy::too_many_arguments)]
12
use crate::pyth::mock::DecodeDataType;
23
use crate::pyth::types::{
34
getEmaPriceNoOlderThanCall, getEmaPriceUnsafeCall, getPriceNoOlderThanCall, getPriceUnsafeCall,
@@ -272,5 +273,5 @@ pub fn create_price_feed_update_data(
272273
};
273274

274275
let price_feed_data_encoding = (price_feed_data, prev_publish_time);
275-
return DecodeDataType::abi_encode(&price_feed_data_encoding);
276+
DecodeDataType::abi_encode(&price_feed_data_encoding)
276277
}

target_chains/ethereum/sdk/stylus/contracts/src/pyth/mock.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(clippy::clone_on_copy)]
2+
#![allow(clippy::too_many_arguments)]
13
use crate::pyth::errors::{Error, PriceFeedNotFound};
24
use crate::pyth::events::PriceFeedUpdate;
35
use crate::pyth::functions::create_price_feed_update_data;
@@ -11,7 +13,7 @@ use alloy_primitives::{Bytes, B256, U256};
1113
use alloy_sol_types::{sol_data::Uint as SolUInt, SolType, SolValue};
1214
use stylus_sdk::{abi::Bytes as AbiBytes, evm, msg, prelude::*};
1315

14-
////Decode data type PriceFeed and uint64
16+
/// Decode data type PriceFeed and uint64
1517
pub type DecodeDataType = (PriceFeed, SolUInt<64>);
1618

1719
sol_storage! {
@@ -169,7 +171,7 @@ impl MockPythContract {
169171
};
170172

171173
let price_feed_data_encoding = (price_feed_data, prev_publish_time);
172-
return DecodeDataType::abi_encode(&price_feed_data_encoding);
174+
DecodeDataType::abi_encode(&price_feed_data_encoding)
173175
}
174176
}
175177

@@ -248,12 +250,12 @@ pub fn create_price_feed_update_data_list() -> (Vec<Bytes>, Vec<B256>) {
248250
.update(x.as_bytes())
249251
.finalize()
250252
.to_vec();
251-
return B256::from_slice(&x);
253+
B256::from_slice(&x)
252254
});
253255
let mut price_feed_data_list = Vec::new();
254-
for i in 0..3 {
256+
for item in &id {
255257
let price_feed_data = create_price_feed_update_data(
256-
id[i],
258+
*item,
257259
100,
258260
100,
259261
100,
@@ -265,7 +267,7 @@ pub fn create_price_feed_update_data_list() -> (Vec<Bytes>, Vec<B256>) {
265267
let price_feed_data = Bytes::from(AbiBytes::from(price_feed_data).0);
266268
price_feed_data_list.push(price_feed_data);
267269
}
268-
return (price_feed_data_list, id.to_vec());
270+
(price_feed_data_list, id.to_vec())
269271
}
270272

271273
#[cfg(all(test, feature = "std"))]

target_chains/ethereum/sdk/stylus/examples/function-example/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![cfg_attr(not(test), no_std, no_main)]
2+
#![allow(clippy::let_unit_value)]
23
extern crate alloc;
34

45
use alloc::vec;

target_chains/ethereum/sdk/stylus/examples/pyth-example/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use pyth_stylus::pyth::{
1010
use stylus_sdk::{abi::Bytes, alloy_primitives::U256, msg, prelude::*, stylus_proc::SolidityError};
1111

1212
pub use sol::*;
13-
#[cfg_attr(coverage_nightly, coverage(off))]
13+
1414
mod sol {
1515
use alloy_sol_types::sol;
1616

0 commit comments

Comments
 (0)