chore: fix clippy (#2059)
This commit is contained in:
parent
5330a688ea
commit
f2099a8eaa
|
@ -4,9 +4,10 @@ use regex::Regex;
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
|
|
||||||
/// Used to filter contracts that should be _included_ in the abigen generation.
|
/// Used to filter contracts that should be _included_ in the abigen generation.
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Default, Clone)]
|
||||||
pub enum ContractFilter {
|
pub enum ContractFilter {
|
||||||
/// Include all contracts
|
/// Include all contracts
|
||||||
|
#[default]
|
||||||
All,
|
All,
|
||||||
/// Only include contracts that match the filter
|
/// Only include contracts that match the filter
|
||||||
Select(SelectContracts),
|
Select(SelectContracts),
|
||||||
|
@ -27,12 +28,6 @@ impl ContractFilter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for ContractFilter {
|
|
||||||
fn default() -> Self {
|
|
||||||
ContractFilter::All
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl From<SelectContracts> for ContractFilter {
|
impl From<SelectContracts> for ContractFilter {
|
||||||
fn from(f: SelectContracts) -> Self {
|
fn from(f: SelectContracts) -> Self {
|
||||||
ContractFilter::Select(f)
|
ContractFilter::Select(f)
|
||||||
|
|
|
@ -152,7 +152,6 @@ impl Abigen {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
#[must_use]
|
|
||||||
#[deprecated = "Use format instead"]
|
#[deprecated = "Use format instead"]
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub fn rustfmt(mut self, rustfmt: bool) -> Self {
|
pub fn rustfmt(mut self, rustfmt: bool) -> Self {
|
||||||
|
|
|
@ -282,7 +282,7 @@ impl<M> Clone for Multicall<M> {
|
||||||
contract: self.contract.clone(),
|
contract: self.contract.clone(),
|
||||||
version: self.version,
|
version: self.version,
|
||||||
legacy: self.legacy,
|
legacy: self.legacy,
|
||||||
block: self.block.clone(),
|
block: self.block,
|
||||||
calls: self.calls.clone(),
|
calls: self.calls.clone(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -355,10 +355,11 @@ pub struct MinedBlock {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The pre-defined block parameter for balance API endpoints
|
/// The pre-defined block parameter for balance API endpoints
|
||||||
#[derive(Clone, Copy, Debug)]
|
#[derive(Clone, Copy, Debug, Default)]
|
||||||
pub enum Tag {
|
pub enum Tag {
|
||||||
Earliest,
|
Earliest,
|
||||||
Pending,
|
Pending,
|
||||||
|
#[default]
|
||||||
Latest,
|
Latest,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -372,12 +373,6 @@ impl Display for Tag {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for Tag {
|
|
||||||
fn default() -> Self {
|
|
||||||
Tag::Latest
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// The list sorting preference
|
/// The list sorting preference
|
||||||
#[derive(Clone, Copy, Debug)]
|
#[derive(Clone, Copy, Debug)]
|
||||||
pub enum Sort {
|
pub enum Sort {
|
||||||
|
@ -466,8 +461,9 @@ impl TokenQueryOption {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The pre-defined block type for retrieving mined blocks
|
/// The pre-defined block type for retrieving mined blocks
|
||||||
#[derive(Copy, Clone, Debug)]
|
#[derive(Copy, Clone, Debug, Default)]
|
||||||
pub enum BlockType {
|
pub enum BlockType {
|
||||||
|
#[default]
|
||||||
CanonicalBlocks,
|
CanonicalBlocks,
|
||||||
Uncles,
|
Uncles,
|
||||||
}
|
}
|
||||||
|
@ -481,12 +477,6 @@ impl Display for BlockType {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for BlockType {
|
|
||||||
fn default() -> Self {
|
|
||||||
BlockType::CanonicalBlocks
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Client {
|
impl Client {
|
||||||
/// Returns the Ether balance of a given address.
|
/// Returns the Ether balance of a given address.
|
||||||
///
|
///
|
||||||
|
|
|
@ -214,12 +214,13 @@ impl<T: JsonRpcClientWrapper> QuorumProvider<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Determines when the provider reached a quorum
|
/// Determines when the provider reached a quorum
|
||||||
#[derive(Debug, Copy, Clone)]
|
#[derive(Debug, Default, Copy, Clone)]
|
||||||
pub enum Quorum {
|
pub enum Quorum {
|
||||||
/// The quorum is reached when all providers return the exact value
|
/// The quorum is reached when all providers return the exact value
|
||||||
All,
|
All,
|
||||||
/// The quorum is reached when the majority of the providers have returned a
|
/// The quorum is reached when the majority of the providers have returned a
|
||||||
/// matching value, taking into account their weight.
|
/// matching value, taking into account their weight.
|
||||||
|
#[default]
|
||||||
Majority,
|
Majority,
|
||||||
/// The quorum is reached when the cumulative weight of a matching return
|
/// The quorum is reached when the cumulative weight of a matching return
|
||||||
/// exceeds the given percentage of the total weight.
|
/// exceeds the given percentage of the total weight.
|
||||||
|
@ -257,12 +258,6 @@ impl Quorum {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for Quorum {
|
|
||||||
fn default() -> Self {
|
|
||||||
Quorum::Majority
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// A future that returns the provider's response and it's index within the
|
// A future that returns the provider's response and it's index within the
|
||||||
// `QuorumProvider` provider set
|
// `QuorumProvider` provider set
|
||||||
#[cfg(target_arch = "wasm32")]
|
#[cfg(target_arch = "wasm32")]
|
||||||
|
|
|
@ -677,7 +677,7 @@ pub struct YulDetails {
|
||||||
pub optimizer_steps: Option<String>,
|
pub optimizer_steps: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
|
#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
|
||||||
pub enum EvmVersion {
|
pub enum EvmVersion {
|
||||||
Homestead,
|
Homestead,
|
||||||
TangerineWhistle,
|
TangerineWhistle,
|
||||||
|
@ -687,15 +687,10 @@ pub enum EvmVersion {
|
||||||
Petersburg,
|
Petersburg,
|
||||||
Istanbul,
|
Istanbul,
|
||||||
Berlin,
|
Berlin,
|
||||||
|
#[default]
|
||||||
London,
|
London,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for EvmVersion {
|
|
||||||
fn default() -> Self {
|
|
||||||
Self::London
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl EvmVersion {
|
impl EvmVersion {
|
||||||
/// Checks against the given solidity `semver::Version`
|
/// Checks against the given solidity `semver::Version`
|
||||||
pub fn normalize_version(self, version: &Version) -> Option<EvmVersion> {
|
pub fn normalize_version(self, version: &Version) -> Option<EvmVersion> {
|
||||||
|
@ -786,9 +781,10 @@ pub struct DebuggingSettings {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// How to treat revert (and require) reason strings.
|
/// How to treat revert (and require) reason strings.
|
||||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
|
#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
|
||||||
pub enum RevertStrings {
|
pub enum RevertStrings {
|
||||||
/// "default" does not inject compiler-generated revert strings and keeps user-supplied ones.
|
/// "default" does not inject compiler-generated revert strings and keeps user-supplied ones.
|
||||||
|
#[default]
|
||||||
Default,
|
Default,
|
||||||
/// "strip" removes all revert strings (if possible, i.e. if literals are used) keeping
|
/// "strip" removes all revert strings (if possible, i.e. if literals are used) keeping
|
||||||
/// side-effects
|
/// side-effects
|
||||||
|
@ -827,12 +823,6 @@ impl FromStr for RevertStrings {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for RevertStrings {
|
|
||||||
fn default() -> Self {
|
|
||||||
RevertStrings::Default
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
pub struct SettingsMetadata {
|
pub struct SettingsMetadata {
|
||||||
/// Use only literal content and not URLs (false by default)
|
/// Use only literal content and not URLs (false by default)
|
||||||
|
@ -868,19 +858,14 @@ impl From<BytecodeHash> for SettingsMetadata {
|
||||||
/// Determines the hash method for the metadata hash that is appended to the bytecode.
|
/// Determines the hash method for the metadata hash that is appended to the bytecode.
|
||||||
///
|
///
|
||||||
/// Solc's default is `Ipfs`, see <https://docs.soliditylang.org/en/latest/using-the-compiler.html#compiler-api>.
|
/// Solc's default is `Ipfs`, see <https://docs.soliditylang.org/en/latest/using-the-compiler.html#compiler-api>.
|
||||||
#[derive(Clone, Debug, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Default, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
pub enum BytecodeHash {
|
pub enum BytecodeHash {
|
||||||
|
#[default]
|
||||||
Ipfs,
|
Ipfs,
|
||||||
None,
|
None,
|
||||||
Bzzr1,
|
Bzzr1,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for BytecodeHash {
|
|
||||||
fn default() -> Self {
|
|
||||||
BytecodeHash::Ipfs
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl FromStr for BytecodeHash {
|
impl FromStr for BytecodeHash {
|
||||||
type Err = String;
|
type Err = String;
|
||||||
|
|
||||||
|
@ -1036,8 +1021,9 @@ pub struct ModelCheckerSettings {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Which model checker engine to run.
|
/// Which model checker engine to run.
|
||||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
pub enum ModelCheckerEngine {
|
pub enum ModelCheckerEngine {
|
||||||
|
#[default]
|
||||||
Default,
|
Default,
|
||||||
All,
|
All,
|
||||||
BMC,
|
BMC,
|
||||||
|
@ -1070,12 +1056,6 @@ impl FromStr for ModelCheckerEngine {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for ModelCheckerEngine {
|
|
||||||
fn default() -> Self {
|
|
||||||
ModelCheckerEngine::Default
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Which model checker targets to check.
|
/// Which model checker targets to check.
|
||||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
|
|
|
@ -53,11 +53,13 @@ impl FileFilter for TestFileFilter {
|
||||||
|
|
||||||
/// A type that can apply a filter to a set of preprocessed [FilteredSources] in order to set sparse
|
/// A type that can apply a filter to a set of preprocessed [FilteredSources] in order to set sparse
|
||||||
/// output for specific files
|
/// output for specific files
|
||||||
|
#[derive(Default)]
|
||||||
pub enum SparseOutputFilter {
|
pub enum SparseOutputFilter {
|
||||||
/// Sets the configured [OutputSelection] for dirty files only.
|
/// Sets the configured [OutputSelection] for dirty files only.
|
||||||
///
|
///
|
||||||
/// In other words, we request the output of solc only for files that have been detected as
|
/// In other words, we request the output of solc only for files that have been detected as
|
||||||
/// _dirty_.
|
/// _dirty_.
|
||||||
|
#[default]
|
||||||
AllDirty,
|
AllDirty,
|
||||||
/// Apply an additional filter to [FilteredSources] to
|
/// Apply an additional filter to [FilteredSources] to
|
||||||
Custom(Box<dyn FileFilter>),
|
Custom(Box<dyn FileFilter>),
|
||||||
|
@ -176,12 +178,6 @@ impl From<Box<dyn FileFilter>> for SparseOutputFilter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for SparseOutputFilter {
|
|
||||||
fn default() -> Self {
|
|
||||||
SparseOutputFilter::AllDirty
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl fmt::Debug for SparseOutputFilter {
|
impl fmt::Debug for SparseOutputFilter {
|
||||||
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
|
|
|
@ -1,25 +1,16 @@
|
||||||
use crate::Graph;
|
use crate::Graph;
|
||||||
use std::{collections::HashSet, io, io::Write, str::FromStr};
|
use std::{collections::HashSet, io, io::Write, str::FromStr};
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, Eq, PartialEq)]
|
#[derive(Debug, Default, Clone, Copy, Eq, PartialEq)]
|
||||||
pub enum Charset {
|
pub enum Charset {
|
||||||
|
// when operating in a console on windows non-UTF-8 byte sequences are not supported on
|
||||||
|
// stdout, See also [`StdoutLock`]
|
||||||
|
#[cfg_attr(target_os = "windows", default)]
|
||||||
Utf8,
|
Utf8,
|
||||||
|
#[cfg_attr(not(target_os = "windows"), default)]
|
||||||
Ascii,
|
Ascii,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for Charset {
|
|
||||||
fn default() -> Self {
|
|
||||||
// when operating in a console on windows non-UTF-8 byte sequences are not supported on
|
|
||||||
// stdout, See also [`StdoutLock`]
|
|
||||||
#[cfg(target_os = "windows")]
|
|
||||||
{
|
|
||||||
Charset::Ascii
|
|
||||||
}
|
|
||||||
#[cfg(not(target_os = "windows"))]
|
|
||||||
Charset::Utf8
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl FromStr for Charset {
|
impl FromStr for Charset {
|
||||||
type Err = String;
|
type Err = String;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue