From cffcc7bbec2f34bc0b11a522d374b816587070e4 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Mon, 23 May 2022 00:18:57 +0200 Subject: [PATCH] chore(clippy): fix newest nightly lints (#1298) --- ethers-contract/src/log.rs | 2 +- ethers-contract/tests/common/derive.rs | 38 +++++++++---------- ethers-core/src/abi/human_readable/lexer.rs | 4 +- ethers-core/src/abi/struct_def.rs | 2 +- ethers-core/src/types/block.rs | 6 +-- ethers-core/src/types/log.rs | 8 ++-- ethers-core/src/types/proof.rs | 4 +- ethers-core/src/types/signature.rs | 2 +- ethers-core/src/types/trace/filter.rs | 26 ++++++------- ethers-core/src/types/trace/mod.rs | 8 ++-- ethers-core/src/types/transaction/eip2718.rs | 8 ++-- ethers-core/src/types/transaction/eip2930.rs | 2 +- ethers-core/src/types/transaction/response.rs | 4 +- ethers-core/src/types/txpool.rs | 8 ++-- ethers-providers/src/erc.rs | 2 +- ethers-signers/src/wallet/mnemonic.rs | 2 +- ethers-solc/src/compile/output/sources.rs | 4 +- ethers-solc/src/remappings.rs | 2 +- ethers-solc/src/resolver/parse.rs | 2 +- ethers-solc/src/sourcemap.rs | 2 +- 20 files changed, 68 insertions(+), 68 deletions(-) diff --git a/ethers-contract/src/log.rs b/ethers-contract/src/log.rs index 6e54e381..d0318424 100644 --- a/ethers-contract/src/log.rs +++ b/ethers-contract/src/log.rs @@ -19,7 +19,7 @@ pub fn decode_logs(logs: &[RawLog]) -> Result, Error> { } /// Metadata inside a log -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct LogMeta { /// Address from which this log originated pub address: Address, diff --git a/ethers-contract/tests/common/derive.rs b/ethers-contract/tests/common/derive.rs index 95fe53c3..e60f563f 100644 --- a/ethers-contract/tests/common/derive.rs +++ b/ethers-contract/tests/common/derive.rs @@ -9,7 +9,7 @@ use ethers_core::{ fn assert_tokenizeable() {} fn assert_ethcall() {} -#[derive(Debug, Clone, PartialEq, EthAbiType)] +#[derive(Debug, Clone, PartialEq, Eq, EthAbiType)] struct ValueChanged { old_author: Address, new_author: Address, @@ -23,7 +23,7 @@ struct ValueChangedWrapper { msg: String, } -#[derive(Debug, Clone, PartialEq, EthAbiType)] +#[derive(Debug, Clone, PartialEq, Eq, EthAbiType)] struct ValueChangedTuple(Address, Address, String, String); #[derive(Debug, Clone, PartialEq, EthAbiType)] @@ -49,13 +49,13 @@ fn can_detokenize_struct() { #[test] fn can_derive_abi_type_empty_struct() { - #[derive(Debug, Clone, PartialEq, EthAbiType)] + #[derive(Debug, Clone, PartialEq, Eq, EthAbiType)] struct Call(); - #[derive(Debug, Clone, PartialEq, EthAbiType)] + #[derive(Debug, Clone, PartialEq, Eq, EthAbiType)] struct Call2 {}; - #[derive(Debug, Clone, PartialEq, EthAbiType)] + #[derive(Debug, Clone, PartialEq, Eq, EthAbiType)] struct Call3; assert_tokenizeable::(); @@ -130,7 +130,7 @@ fn can_detokenize_single_field() { #[test] fn can_derive_eth_event() { - #[derive(Debug, Clone, PartialEq, EthEvent)] + #[derive(Debug, Clone, PartialEq, Eq, EthEvent)] struct ValueChangedEvent { old_author: Address, new_author: Address, @@ -157,7 +157,7 @@ fn can_derive_eth_event() { #[test] fn can_set_eth_event_name_attribute() { - #[derive(Debug, PartialEq, EthEvent)] + #[derive(Debug, PartialEq, Eq, EthEvent)] #[ethevent(name = "MyEvent")] struct ValueChangedEvent { old_author: Address, @@ -172,7 +172,7 @@ fn can_set_eth_event_name_attribute() { #[test] fn can_detect_various_event_abi_types() { - #[derive(Debug, PartialEq, EthEvent)] + #[derive(Debug, PartialEq, Eq, EthEvent)] struct ValueChangedEvent { old_author: Address, s: String, @@ -204,7 +204,7 @@ fn can_detect_various_event_abi_types() { #[test] fn can_set_eth_abi_attribute() { - #[derive(Debug, Clone, PartialEq, EthAbiType)] + #[derive(Debug, Clone, PartialEq, Eq, EthAbiType)] struct SomeType { inner: Address, msg: String, @@ -242,7 +242,7 @@ fn can_set_eth_abi_attribute() { #[test] fn can_derive_indexed_and_anonymous_attribute() { - #[derive(Debug, PartialEq, EthEvent)] + #[derive(Debug, PartialEq, Eq, EthEvent)] #[ethevent(anonymous)] struct ValueChangedEvent { old_author: Address, @@ -280,7 +280,7 @@ fn can_generate_ethevent_from_json() { #[test] fn can_decode_event_with_no_topics() { - #[derive(Debug, PartialEq, EthEvent)] + #[derive(Debug, PartialEq, Eq, EthEvent)] pub struct LiquidateBorrow { liquidator: Address, borrower: Address, @@ -310,7 +310,7 @@ fn can_decode_event_with_no_topics() { #[test] fn can_decode_event_single_param() { - #[derive(Debug, PartialEq, EthEvent)] + #[derive(Debug, PartialEq, Eq, EthEvent)] pub struct OneParam { #[ethevent(indexed)] param1: U256, @@ -330,7 +330,7 @@ fn can_decode_event_single_param() { #[test] fn can_decode_event_tuple_single_param() { - #[derive(Debug, PartialEq, EthEvent)] + #[derive(Debug, PartialEq, Eq, EthEvent)] struct OneParam(#[ethevent(indexed)] U256); let log = RawLog { @@ -347,7 +347,7 @@ fn can_decode_event_tuple_single_param() { #[test] fn can_decode_event_with_no_params() { - #[derive(Debug, PartialEq, EthEvent)] + #[derive(Debug, PartialEq, Eq, EthEvent)] pub struct NoParam {} let log = RawLog { @@ -446,7 +446,7 @@ fn can_derive_ethcall() { #[test] fn can_derive_ethcall_with_nested_structs() { - #[derive(Debug, Clone, PartialEq, EthAbiType)] + #[derive(Debug, Clone, PartialEq, Eq, EthAbiType)] struct SomeType { inner: Address, msg: String, @@ -468,7 +468,7 @@ fn can_derive_ethcall_with_nested_structs() { #[test] fn can_derive_for_enum() { - #[derive(Debug, Clone, PartialEq, EthAbiType)] + #[derive(Debug, Clone, PartialEq, Eq, EthAbiType)] enum ActionChoices { GoLeft, GoRight, @@ -483,7 +483,7 @@ fn can_derive_for_enum() { #[test] fn can_derive_abi_codec() { - #[derive(Debug, Clone, PartialEq, EthAbiType, EthAbiCodec)] + #[derive(Debug, Clone, PartialEq, Eq, EthAbiType, EthAbiCodec)] pub struct SomeType { inner: Address, msg: String, @@ -498,7 +498,7 @@ fn can_derive_abi_codec() { #[test] fn can_derive_abi_codec_single_field() { - #[derive(Debug, Clone, PartialEq, EthAbiType, EthAbiCodec)] + #[derive(Debug, Clone, PartialEq, Eq, EthAbiType, EthAbiCodec)] pub struct SomeType { inner: Vec, } @@ -530,7 +530,7 @@ fn can_derive_abi_codec_single_field() { #[test] fn can_derive_abi_codec_two_field() { - #[derive(Debug, Clone, PartialEq, EthAbiType, EthAbiCodec)] + #[derive(Debug, Clone, PartialEq, Eq, EthAbiType, EthAbiCodec)] pub struct SomeType { inner: Vec, addr: Address, diff --git a/ethers-core/src/abi/human_readable/lexer.rs b/ethers-core/src/abi/human_readable/lexer.rs index 907f39e3..216f369d 100644 --- a/ethers-core/src/abi/human_readable/lexer.rs +++ b/ethers-core/src/abi/human_readable/lexer.rs @@ -10,7 +10,7 @@ macro_rules! unrecognised { }; } -#[derive(Copy, Clone, PartialEq, Debug)] +#[derive(Copy, Clone, PartialEq, Eq, Debug)] pub enum Token<'input> { Identifier(&'input str), Number(&'input str), @@ -140,7 +140,7 @@ impl<'input> fmt::Display for Token<'input> { } } -#[derive(Debug, PartialEq, Clone, thiserror::Error)] +#[derive(Debug, PartialEq, Eq, Clone, thiserror::Error)] pub enum LexerError { #[error("UnrecognisedToken {0}:{1} `{2}`")] UnrecognisedToken(usize, usize, String), diff --git a/ethers-core/src/abi/struct_def.rs b/ethers-core/src/abi/struct_def.rs index d9545aca..b4bf661d 100644 --- a/ethers-core/src/abi/struct_def.rs +++ b/ethers-core/src/abi/struct_def.rs @@ -74,7 +74,7 @@ pub struct StructFieldDeclaration { } /// How the type of a struct field is referenced -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct StructType { /// The name of the struct (or rather the name of the rust type) name: String, diff --git a/ethers-core/src/types/block.rs b/ethers-core/src/types/block.rs index 4a24de83..75beac62 100644 --- a/ethers-core/src/types/block.rs +++ b/ethers-core/src/types/block.rs @@ -379,7 +379,7 @@ impl From> for Block { } } -#[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)] +#[derive(Debug, Default, Clone, PartialEq, Eq, Deserialize, Serialize)] #[cfg(feature = "celo")] /// Commit-reveal data for generating randomness in the /// [Celo protocol](https://docs.celo.org/celo-codebase/protocol/identity/randomness) @@ -390,7 +390,7 @@ pub struct Randomness { pub revealed: Bytes, } -#[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)] +#[derive(Debug, Default, Clone, PartialEq, Eq, Deserialize, Serialize)] #[cfg(feature = "celo")] /// SNARK-friendly epoch block signature and bitmap pub struct EpochSnarkData { @@ -400,7 +400,7 @@ pub struct EpochSnarkData { pub signature: Bytes, } -#[derive(Copy, Clone, Debug, PartialEq)] +#[derive(Copy, Clone, Debug, PartialEq, Eq)] /// A Block Hash or Block Number pub enum BlockId { // TODO: May want to expand this to include the requireCanonical field diff --git a/ethers-core/src/types/log.rs b/ethers-core/src/types/log.rs index 89758434..17ce8c74 100644 --- a/ethers-core/src/types/log.rs +++ b/ethers-core/src/types/log.rs @@ -9,7 +9,7 @@ use serde::{ use std::ops::{Range, RangeFrom, RangeTo}; /// A log produced by a transaction. -#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub struct Log { /// H160. the contract that emitted the log pub address: Address, @@ -74,7 +74,7 @@ impl rlp::Encodable for Log { } } -#[derive(Copy, Clone, Debug, PartialEq)] +#[derive(Copy, Clone, Debug, PartialEq, Eq)] pub enum FilterBlockOption { Range { from_block: Option, to_block: Option }, AtBlockHash(H256), @@ -157,7 +157,7 @@ impl FilterBlockOption { } /// Filter for -#[derive(Default, Debug, PartialEq, Clone)] +#[derive(Default, Debug, PartialEq, Eq, Clone)] pub struct Filter { /// Filter block options, specifying on which blocks the filter should /// match. @@ -471,7 +471,7 @@ mod tests { #[test] fn can_serde_value_or_array() { - #[derive(Clone, Debug, Deserialize, Serialize, PartialEq)] + #[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] struct Item { value: ValueOrArray, } diff --git a/ethers-core/src/types/proof.rs b/ethers-core/src/types/proof.rs index 7ed2277e..011c3576 100644 --- a/ethers-core/src/types/proof.rs +++ b/ethers-core/src/types/proof.rs @@ -1,14 +1,14 @@ use crate::types::{Address, Bytes, H256, U256}; use serde::{Deserialize, Serialize}; -#[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)] +#[derive(Debug, Default, Clone, PartialEq, Eq, Deserialize, Serialize)] pub struct StorageProof { pub key: H256, pub proof: Vec, pub value: U256, } -#[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)] +#[derive(Debug, Default, Clone, PartialEq, Eq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct EIP1186ProofResponse { address: Address, diff --git a/ethers-core/src/types/signature.rs b/ethers-core/src/types/signature.rs index 956695c1..5cddf4e7 100644 --- a/ethers-core/src/types/signature.rs +++ b/ethers-core/src/types/signature.rs @@ -45,7 +45,7 @@ pub enum SignatureError { /// The message data can either be a binary message that is first hashed /// according to EIP-191 and then recovered based on the signature or a /// precomputed hash. -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub enum RecoveryMessage { /// Message bytes Data(Vec), diff --git a/ethers-core/src/types/trace/filter.rs b/ethers-core/src/types/trace/filter.rs index c69cb2cd..f1a2d22c 100644 --- a/ethers-core/src/types/trace/filter.rs +++ b/ethers-core/src/types/trace/filter.rs @@ -3,7 +3,7 @@ use crate::types::{Address, BlockNumber, Bytes, H160, H256, U256}; use serde::{Deserialize, Serialize}; /// Trace filter -#[derive(Debug, Default, Clone, PartialEq, Serialize)] +#[derive(Debug, Default, Clone, PartialEq, Eq, Serialize)] #[serde(deny_unknown_fields)] pub struct TraceFilter { /// From block @@ -76,7 +76,7 @@ impl TraceFilter { // `LocalizedTrace` in Parity /// Trace-Filtering API trace type -#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)] +#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] pub struct Trace { /// Action pub action: Action, @@ -107,7 +107,7 @@ pub struct Trace { } /// Response -#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] +#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)] #[serde(untagged)] pub enum Res { /// Call @@ -125,7 +125,7 @@ impl Default for Res { } /// Action -#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)] #[serde(untagged, rename_all = "lowercase")] pub enum Action { /// Call @@ -139,7 +139,7 @@ pub enum Action { } /// An external action type. -#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)] #[serde(rename_all = "lowercase")] pub enum ActionType { /// Contract call. @@ -153,7 +153,7 @@ pub enum ActionType { } /// Call Result -#[derive(Debug, Clone, PartialEq, Default, Deserialize, Serialize)] +#[derive(Debug, Clone, PartialEq, Eq, Default, Deserialize, Serialize)] pub struct CallResult { /// Gas used #[serde(rename = "gasUsed")] @@ -163,7 +163,7 @@ pub struct CallResult { } /// Create Result -#[derive(Debug, Clone, PartialEq, Default, Deserialize, Serialize)] +#[derive(Debug, Clone, PartialEq, Eq, Default, Deserialize, Serialize)] pub struct CreateResult { /// Gas used #[serde(rename = "gasUsed")] @@ -175,7 +175,7 @@ pub struct CreateResult { } /// Call response -#[derive(Debug, Clone, PartialEq, Default, Deserialize, Serialize)] +#[derive(Debug, Clone, PartialEq, Eq, Default, Deserialize, Serialize)] pub struct Call { /// Sender pub from: Address, @@ -193,7 +193,7 @@ pub struct Call { } /// Call type. -#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] +#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)] pub enum CallType { /// None #[serde(rename = "none")] @@ -219,7 +219,7 @@ impl Default for CallType { } /// Create response -#[derive(Debug, Clone, PartialEq, Default, Deserialize, Serialize)] +#[derive(Debug, Clone, PartialEq, Eq, Default, Deserialize, Serialize)] pub struct Create { /// Sender pub from: Address, @@ -232,7 +232,7 @@ pub struct Create { } /// Suicide -#[derive(Debug, Clone, PartialEq, Default, Deserialize, Serialize)] +#[derive(Debug, Clone, PartialEq, Eq, Default, Deserialize, Serialize)] pub struct Suicide { /// Address. pub address: Address, @@ -244,7 +244,7 @@ pub struct Suicide { } /// Reward action -#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] +#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)] pub struct Reward { /// Author's address. pub author: Address, @@ -256,7 +256,7 @@ pub struct Reward { } /// Reward type. -#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] +#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)] pub enum RewardType { /// Block #[serde(rename = "block")] diff --git a/ethers-core/src/types/trace/mod.rs b/ethers-core/src/types/trace/mod.rs index 3eceb6a7..26736ce8 100644 --- a/ethers-core/src/types/trace/mod.rs +++ b/ethers-core/src/types/trace/mod.rs @@ -86,7 +86,7 @@ pub struct StateDiff(pub BTreeMap); // ------------------ Trace ------------- /// Trace -#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)] +#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] pub struct TransactionTrace { /// Trace address #[serde(rename = "traceAddress")] @@ -130,7 +130,7 @@ pub struct VMOperation { pub sub: Option, } -#[derive(Debug, Clone, PartialEq, Default, Deserialize, Serialize)] +#[derive(Debug, Clone, PartialEq, Eq, Default, Deserialize, Serialize)] #[allow(clippy::upper_case_acronyms)] /// A record of an executed VM operation. pub struct VMExecutedOperation { @@ -147,7 +147,7 @@ pub struct VMExecutedOperation { pub store: Option, } -#[derive(Debug, Clone, PartialEq, Default, Deserialize, Serialize)] +#[derive(Debug, Clone, PartialEq, Eq, Default, Deserialize, Serialize)] #[allow(clippy::upper_case_acronyms)] /// A diff of some chunk of memory. pub struct MemoryDiff { @@ -157,7 +157,7 @@ pub struct MemoryDiff { pub data: Bytes, } -#[derive(Debug, Clone, PartialEq, Default, Deserialize, Serialize)] +#[derive(Debug, Clone, PartialEq, Eq, Default, Deserialize, Serialize)] #[allow(clippy::upper_case_acronyms)] /// A diff of some storage value. pub struct StorageDiff { diff --git a/ethers-core/src/types/transaction/eip2718.rs b/ethers-core/src/types/transaction/eip2718.rs index 56fcfafa..b87f0abf 100644 --- a/ethers-core/src/types/transaction/eip2718.rs +++ b/ethers-core/src/types/transaction/eip2718.rs @@ -24,7 +24,7 @@ use thiserror::Error; /// the `legacy` crate feature. This will disable the `type` flag in the /// serialized transaction, and cause contract calls and other common actions /// to default to using the legacy transaction type. -#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +#[derive(Serialize, Deserialize, Clone, PartialEq, Eq, Debug)] #[cfg_attr(not(feature = "legacy"), serde(tag = "type"))] #[cfg_attr(feature = "legacy", serde(untagged))] pub enum TypedTransaction { @@ -742,7 +742,7 @@ mod tests { let tx = TypedTransaction::decode(&tx_rlp).unwrap(); { - let typed_tx: TypedTransaction = tx.clone().into(); + let typed_tx: TypedTransaction = tx.clone(); let tx0: TransactionRequest = typed_tx.clone().into(); assert!(typed_tx.as_legacy_ref().is_none()); @@ -752,7 +752,7 @@ mod tests { assert_eq!(tx0, tx1); } { - let typed_tx: TypedTransaction = tx.clone().into(); + let typed_tx: TypedTransaction = tx.clone(); let tx0: Eip1559TransactionRequest = typed_tx.clone().into(); assert_eq!(tx.as_eip1559_ref().unwrap(), &tx0); @@ -761,7 +761,7 @@ mod tests { assert_eq!(tx0, tx1); } { - let typed_tx: TypedTransaction = tx.clone().into(); + let typed_tx: TypedTransaction = tx; let tx0: Eip2930TransactionRequest = typed_tx.clone().into(); assert!(typed_tx.as_eip2930_ref().is_none()); diff --git a/ethers-core/src/types/transaction/eip2930.rs b/ethers-core/src/types/transaction/eip2930.rs index 3defdad6..1599072d 100644 --- a/ethers-core/src/types/transaction/eip2930.rs +++ b/ethers-core/src/types/transaction/eip2930.rs @@ -73,7 +73,7 @@ pub enum Eip2930RequestError { } /// An EIP-2930 transaction is a legacy transaction including an [`AccessList`]. -#[derive(Clone, Serialize, Deserialize, PartialEq, Debug)] +#[derive(Clone, Serialize, Deserialize, PartialEq, Eq, Debug)] pub struct Eip2930TransactionRequest { #[serde(flatten)] pub tx: TransactionRequest, diff --git a/ethers-core/src/types/transaction/response.rs b/ethers-core/src/types/transaction/response.rs index b30e89b3..056dbdfd 100644 --- a/ethers-core/src/types/transaction/response.rs +++ b/ethers-core/src/types/transaction/response.rs @@ -11,7 +11,7 @@ use rlp::{Decodable, DecoderError, RlpStream}; use serde::{Deserialize, Serialize}; /// Details of a signed transaction -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)] pub struct Transaction { /// The transaction's hash pub hash: H256, @@ -370,7 +370,7 @@ impl Decodable for Transaction { } /// "Receipt" of an executed transaction: details of its execution. -#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Default, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct TransactionReceipt { /// Transaction hash. #[serde(rename = "transactionHash")] diff --git a/ethers-core/src/types/txpool.rs b/ethers-core/src/types/txpool.rs index 146a5dae..5f6ce423 100644 --- a/ethers-core/src/types/txpool.rs +++ b/ethers-core/src/types/txpool.rs @@ -7,7 +7,7 @@ use serde::{ use std::{collections::BTreeMap, fmt, str::FromStr}; /// Transaction summary as found in the Txpool Inspection property. -#[derive(Debug, Clone, PartialEq, Serialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize)] pub struct TxpoolInspectSummary { /// Recipient (None when contract creation) pub to: Option
, @@ -90,7 +90,7 @@ impl<'de> Deserialize<'de> for TxpoolInspectSummary { /// as the ones that are being scheduled for future execution only. /// /// See [here](https://geth.ethereum.org/docs/rpc/ns-txpool#txpool_content) for more details -#[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)] +#[derive(Debug, Default, Clone, PartialEq, Eq, Deserialize, Serialize)] pub struct TxpoolContent { /// pending tx pub pending: BTreeMap>, @@ -107,7 +107,7 @@ pub struct TxpoolContent { /// transactions in the pool and find any potential issues. /// /// See [here](https://geth.ethereum.org/docs/rpc/ns-txpool#txpool_inspect) for more details -#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Default, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct TxpoolInspect { /// pending tx pub pending: BTreeMap>, @@ -122,7 +122,7 @@ pub struct TxpoolInspect { /// are being scheduled for future execution only. /// /// See [here](https://geth.ethereum.org/docs/rpc/ns-txpool#txpool_status) for more details -#[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)] +#[derive(Debug, Default, Clone, PartialEq, Eq, Deserialize, Serialize)] pub struct TxpoolStatus { /// number of pending tx pub pending: U64, diff --git a/ethers-providers/src/erc.rs b/ethers-providers/src/erc.rs index 22e2b624..b139f860 100644 --- a/ethers-providers/src/erc.rs +++ b/ethers-providers/src/erc.rs @@ -54,7 +54,7 @@ impl FromStr for ERCNFT { } /// Supported ERCs -#[derive(PartialEq)] +#[derive(PartialEq, Eq)] pub enum ERCNFTType { ERC721, ERC1155, diff --git a/ethers-signers/src/wallet/mnemonic.rs b/ethers-signers/src/wallet/mnemonic.rs index f9329b2a..60b559b8 100644 --- a/ethers-signers/src/wallet/mnemonic.rs +++ b/ethers-signers/src/wallet/mnemonic.rs @@ -16,7 +16,7 @@ use thiserror::Error; const DEFAULT_DERIVATION_PATH_PREFIX: &str = "m/44'/60'/0'/0/"; /// Represents a structure that can resolve into a `Wallet`. -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub struct MnemonicBuilder { /// The mnemonic phrase can be supplied to the builder as a string or a path to the file whose /// contents are the phrase. A builder that has a valid phrase should `build` the wallet. diff --git a/ethers-solc/src/compile/output/sources.rs b/ethers-solc/src/compile/output/sources.rs index 4a9a556e..b1f52a53 100644 --- a/ethers-solc/src/compile/output/sources.rs +++ b/ethers-solc/src/compile/output/sources.rs @@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize}; use std::{collections::BTreeMap, path::Path}; /// (source_file path -> `SourceFile` + solc version) -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize)] #[serde(transparent)] pub struct VersionedSourceFiles(pub BTreeMap>); @@ -277,7 +277,7 @@ impl IntoIterator for VersionedSourceFiles { } /// A [SourceFile] and the compiler version used to compile it -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct VersionedSourceFile { pub source_file: SourceFile, pub version: Version, diff --git a/ethers-solc/src/remappings.rs b/ethers-solc/src/remappings.rs index 9ca337d5..e8902673 100644 --- a/ethers-solc/src/remappings.rs +++ b/ethers-solc/src/remappings.rs @@ -57,7 +57,7 @@ impl Remapping { } } -#[derive(thiserror::Error, Debug, PartialEq, PartialOrd)] +#[derive(thiserror::Error, Debug, PartialEq, Eq, PartialOrd)] pub enum RemappingError { #[error("no prefix found")] NoPrefix, diff --git a/ethers-solc/src/resolver/parse.rs b/ethers-solc/src/resolver/parse.rs index 642b5104..94436525 100644 --- a/ethers-solc/src/resolver/parse.rs +++ b/ethers-solc/src/resolver/parse.rs @@ -144,7 +144,7 @@ pub struct SolImport { aliases: Vec, } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum SolImportAlias { File(String), Contract(String, String), diff --git a/ethers-solc/src/sourcemap.rs b/ethers-solc/src/sourcemap.rs index e1cf8a62..bc77f62e 100644 --- a/ethers-solc/src/sourcemap.rs +++ b/ethers-solc/src/sourcemap.rs @@ -22,7 +22,7 @@ impl SyntaxError { } } -#[derive(PartialEq)] +#[derive(PartialEq, Eq)] enum Token<'a> { Number(&'a str), Semicolon,