Skip to content

Commit 5ae9766

Browse files
committed
[all resource export] fixed clippy
1 parent 06e6c5f commit 5ae9766

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

cmd/resource-code-exporter/src/export.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use starcoin_statedb::{ChainStateDB, ChainStateReader};
66
use starcoin_storage::{
77
db_storage::DBStorage, storage::StorageInstance, BlockStore, Storage, StorageVersion,
88
};
9-
use std::{fmt::Debug, io::Write, path::Path, sync::Arc};
9+
use std::{io::Write, path::Path, sync::Arc};
1010

1111
/// Export resources and code from storage for a specific block
1212
pub fn export(db: &str, output: &Path, block_id: HashValue) -> anyhow::Result<()> {
@@ -81,15 +81,12 @@ pub fn export_from_statedb<W: Write>(
8181
#[cfg(test)]
8282
mod test {
8383
use super::*;
84-
use starcoin_config::ChainNetwork;
8584
use std::io::Cursor;
86-
use tempfile::TempDir;
8785
use test_helper::executor::prepare_genesis;
8886

8987
#[test]
9088
fn test_export_from_statedb() -> anyhow::Result<()> {
9189
// Initialize test storage with genesis
92-
let net = ChainNetwork::new_test();
9390
let (chain_statedb, _net) = prepare_genesis();
9491

9592
// Create a buffer to write CSV data
@@ -108,7 +105,7 @@ mod test {
108105
let mut csv_reader = csv::Reader::from_reader(data_str.as_bytes());
109106
let mut has_data = false;
110107
for result in csv_reader.records() {
111-
let record = result?;
108+
let _record = result?;
112109
// println!("Record: {:?}", record);
113110
has_data = true;
114111
}

cmd/resource-code-exporter/src/import.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
1+
// Copyright (c) The Starcoin Core Contributors
2+
// SPDX-License-Identifier: Apache-2.0
3+
14
use starcoin_crypto::HashValue;
25
use starcoin_statedb::{ChainStateDB, ChainStateReader, ChainStateWriter};
36
use starcoin_storage::{db_storage::DBStorage, storage::StorageInstance, Storage, StorageVersion};
47
use starcoin_types::{
58
account_address::AccountAddress,
69
state_set::{AccountStateSet, ChainStateSet},
710
};
8-
use std::path::{Path, PathBuf};
11+
use std::path::Path;
912
use std::sync::Arc;
1013

11-
pub fn import(csv_path: &PathBuf, db_path: &PathBuf) -> anyhow::Result<()> {
14+
pub fn import(csv_path: &Path, db_path: &Path) -> anyhow::Result<()> {
1215
let db_storage = DBStorage::open_with_cfs(
13-
&db_path,
16+
db_path,
1417
StorageVersion::current_version()
1518
.get_column_family_names()
1619
.to_vec(),

0 commit comments

Comments
 (0)