Skip to content

Commit

Permalink
Fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
keithtensor committed Sep 17, 2024
1 parent fc05f24 commit f80f9e2
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 40 deletions.
2 changes: 0 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions client/cli/src/frontier_db_cmd/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ fn commitment_create() {

// Test client.
let (c, _) = TestClientBuilder::new().build_with_native_executor::<RuntimeApi, _>(None);
let mut client = Arc::new(c);
let client = Arc::new(c);

// Get some transaction status.
let t1 = fp_rpc::TransactionStatus::default();
Expand Down Expand Up @@ -612,7 +612,7 @@ fn commitment_update() {

// Test client.
let (c, _) = TestClientBuilder::new().build_with_native_executor::<RuntimeApi, _>(None);
let mut client = Arc::new(c);
let client = Arc::new(c);

// Get some transaction status.
let t1 = fp_rpc::TransactionStatus::default();
Expand Down Expand Up @@ -748,7 +748,7 @@ fn mapping_read_works() {

// Test client.
let (c, _) = TestClientBuilder::new().build_with_native_executor::<RuntimeApi, _>(None);
let mut client = Arc::new(c);
let client = Arc::new(c);

// Get some transaction status.
let t1 = fp_rpc::TransactionStatus::default();
Expand Down
4 changes: 0 additions & 4 deletions client/cli/src/frontier_db_cmd/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ pub trait FrontierDbMessage {
format!("Operation not allowed for non-empty Key `{:?}`", key).into()
}

fn one_to_many_error(&self) -> sc_cli::Error {
"One-to-many operation not allowed".into()
}

#[cfg(not(test))]
fn confirmation_prompt<K: core::fmt::Debug, V: core::fmt::Debug>(
&self,
Expand Down
2 changes: 1 addition & 1 deletion client/db/src/kv/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ mod tests {
.build_with_native_executor::<substrate_test_runtime_client::runtime::RuntimeApi, _>(
None,
);
let mut client = Arc::new(client);
let client = Arc::new(client);

// Genesis block
let chain_info = client.chain_info();
Expand Down
4 changes: 2 additions & 2 deletions client/mapping-sync/src/kv/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ mod tests {
// Client
let (client, _) =
builder.build_with_native_executor::<frontier_template_runtime::RuntimeApi, _>(None);
let mut client = Arc::new(client);
let client = Arc::new(client);
// Overrides
let storage_override = Arc::new(SchemaV3StorageOverride::new(client.clone()));

Expand Down Expand Up @@ -388,7 +388,7 @@ mod tests {
// Client
let (client, _) =
builder.build_with_native_executor::<frontier_template_runtime::RuntimeApi, _>(None);
let mut client = Arc::new(client);
let client = Arc::new(client);
// Overrides
let storage_override = Arc::new(SchemaV3StorageOverride::new(client.clone()));

Expand Down
20 changes: 10 additions & 10 deletions client/mapping-sync/src/sql/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ mod test {
// Client
let (client, _) =
builder.build_with_native_executor::<frontier_template_runtime::RuntimeApi, _>(None);
let mut client = Arc::new(client);
let client = Arc::new(client);
// Overrides
let storage_override = Arc::new(SchemaV3StorageOverride::new(client.clone()));
// Indexer backend
Expand Down Expand Up @@ -750,7 +750,7 @@ mod test {
// Client
let (client, _) =
builder.build_with_native_executor::<frontier_template_runtime::RuntimeApi, _>(None);
let mut client = Arc::new(client);
let client = Arc::new(client);
// Overrides
let storage_override = Arc::new(SchemaV3StorageOverride::new(client.clone()));
// Indexer backend
Expand Down Expand Up @@ -954,7 +954,7 @@ mod test {
// Client
let (client, _) =
builder.build_with_native_executor::<frontier_template_runtime::RuntimeApi, _>(None);
let mut client = Arc::new(client);
let client = Arc::new(client);
// Overrides
let storage_override = Arc::new(SchemaV3StorageOverride::new(client.clone()));
// Indexer backend
Expand Down Expand Up @@ -1120,7 +1120,7 @@ mod test {
// Client
let (client, _) =
builder.build_with_native_executor::<frontier_template_runtime::RuntimeApi, _>(None);
let mut client = Arc::new(client);
let client = Arc::new(client);
// Overrides
let storage_override = Arc::new(SchemaV3StorageOverride::new(client.clone()));
// Indexer backend
Expand Down Expand Up @@ -1266,7 +1266,7 @@ mod test {
let backend = builder.backend();
let (client, _) =
builder.build_with_native_executor::<frontier_template_runtime::RuntimeApi, _>(None);
let mut client = Arc::new(client);
let client = Arc::new(client);
let storage_override = Arc::new(SchemaV3StorageOverride::new(client.clone()));
let indexer_backend = fc_db::sql::Backend::new(
fc_db::sql::BackendConfig::Sqlite(fc_db::sql::SqliteBackendConfig {
Expand Down Expand Up @@ -1367,7 +1367,7 @@ mod test {
let backend = builder.backend();
let (client, _) =
builder.build_with_native_executor::<frontier_template_runtime::RuntimeApi, _>(None);
let mut client = Arc::new(client);
let client = Arc::new(client);
let storage_override = Arc::new(SchemaV3StorageOverride::new(client.clone()));
let indexer_backend = fc_db::sql::Backend::new(
fc_db::sql::BackendConfig::Sqlite(fc_db::sql::SqliteBackendConfig {
Expand Down Expand Up @@ -1482,7 +1482,7 @@ mod test {
let backend = builder.backend();
let (client, _) =
builder.build_with_native_executor::<frontier_template_runtime::RuntimeApi, _>(None);
let mut client = Arc::new(client);
let client = Arc::new(client);
let storage_override = Arc::new(SchemaV3StorageOverride::new(client.clone()));
let indexer_backend = fc_db::sql::Backend::new(
fc_db::sql::BackendConfig::Sqlite(fc_db::sql::SqliteBackendConfig {
Expand Down Expand Up @@ -1583,7 +1583,7 @@ mod test {
let backend = builder.backend();
let (client, _) =
builder.build_with_native_executor::<frontier_template_runtime::RuntimeApi, _>(None);
let mut client = Arc::new(client);
let client = Arc::new(client);
let storage_override = Arc::new(SchemaV3StorageOverride::new(client.clone()));
let indexer_backend = fc_db::sql::Backend::new(
fc_db::sql::BackendConfig::Sqlite(fc_db::sql::SqliteBackendConfig {
Expand Down Expand Up @@ -1698,7 +1698,7 @@ mod test {
let backend = builder.backend();
let (client, _) =
builder.build_with_native_executor::<frontier_template_runtime::RuntimeApi, _>(None);
let mut client = Arc::new(client);
let client = Arc::new(client);
let storage_override = Arc::new(SchemaV3StorageOverride::new(client.clone()));
let indexer_backend = fc_db::sql::Backend::new(
fc_db::sql::BackendConfig::Sqlite(fc_db::sql::SqliteBackendConfig {
Expand Down Expand Up @@ -1799,7 +1799,7 @@ mod test {
let backend = builder.backend();
let (client, _) =
builder.build_with_native_executor::<frontier_template_runtime::RuntimeApi, _>(None);
let mut client = Arc::new(client);
let client = Arc::new(client);
let storage_override = Arc::new(SchemaV3StorageOverride::new(client.clone()));
let indexer_backend = fc_db::sql::Backend::new(
fc_db::sql::BackendConfig::Sqlite(fc_db::sql::SqliteBackendConfig {
Expand Down
10 changes: 5 additions & 5 deletions client/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ pub mod frontier_backend_client {
}
}

pub async fn native_block_id<B: BlockT, C>(
pub async fn native_block_id<B, C>(
client: &C,
backend: &dyn fc_api::Backend<B>,
number: Option<BlockNumberOrHash>,
Expand Down Expand Up @@ -219,7 +219,7 @@ pub mod frontier_backend_client {
})
}

pub async fn load_hash<B: BlockT, C>(
pub async fn load_hash<B, C>(
client: &C,
backend: &dyn fc_api::Backend<B>,
hash: H256,
Expand All @@ -243,7 +243,7 @@ pub mod frontier_backend_client {
Ok(None)
}

pub fn is_canon<B: BlockT, C>(client: &C, target_hash: B::Hash) -> bool
pub fn is_canon<B, C>(client: &C, target_hash: B::Hash) -> bool
where
B: BlockT,
C: HeaderBackend<B> + 'static,
Expand All @@ -256,7 +256,7 @@ pub mod frontier_backend_client {
false
}

pub async fn load_transactions<B: BlockT, C>(
pub async fn load_transactions<B, C>(
client: &C,
backend: &dyn fc_api::Backend<B>,
transaction_hash: H256,
Expand Down Expand Up @@ -389,7 +389,7 @@ mod tests {
None,
);

let mut client = Arc::new(client);
let client = Arc::new(client);

// Create a temporary frontier secondary DB.
let backend = open_frontier_backend::<OpaqueBlock, _>(client.clone(), tmp.into_path())
Expand Down
3 changes: 0 additions & 3 deletions frame/evm/precompile/dispatch/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#![cfg(test)]

use super::*;
use crate::mock::*;

Expand Down
3 changes: 0 additions & 3 deletions frame/evm/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#![cfg(test)]

use super::*;
use crate::mock::*;

Expand Down
3 changes: 0 additions & 3 deletions frame/hotfix-sufficients/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#![cfg(feature = "runtime-benchmarks")]

use frame_benchmarking::{benchmarks, impl_benchmark_test_suite};

use super::*;
Expand Down
4 changes: 3 additions & 1 deletion precompiles/macro/src/precompile/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ pub mod keyword {
syn::custom_keyword!(pre_check);
}

/// Attributes for methods.
/// Attributes for methods
#[allow(dead_code)]
pub enum MethodAttr {
Public(Span, syn::LitStr),
Fallback(Span),
Expand Down Expand Up @@ -106,6 +107,7 @@ impl syn::parse::Parse for MethodAttr {
}

/// Attributes for the main impl Block.
#[allow(dead_code)]
pub enum ImplAttr {
PrecompileSet(Span),
TestConcreteTypes(Span, Vec<syn::Type>),
Expand Down
2 changes: 0 additions & 2 deletions template/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ futures = { workspace = true }
hex-literal = { workspace = true }
jsonrpsee = { workspace = true, features = ["server", "macros"] }
log = { workspace = true }
quote = { workspace = true }
scale-codec = { package = "parity-scale-codec", workspace = true }
serde_json = { workspace = true, features = ["arbitrary_precision"] }

Expand All @@ -38,7 +37,6 @@ sc-network = { workspace = true }
sc-network-sync = { workspace = true }
sc-offchain = { workspace = true }
sc-rpc = { workspace = true }
sc-rpc-api = { workspace = true }
sc-service = { workspace = true }
sc-telemetry = { workspace = true }
sc-transaction-pool = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion template/node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ where
);
}

let role = config.role.clone();
let role = config.role;
let force_authoring = config.force_authoring;
let name = config.network.node_name.clone();
let frontier_backend = Arc::new(frontier_backend);
Expand Down

0 comments on commit f80f9e2

Please sign in to comment.