Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
refactor: corrects clippy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrohba1 committed Apr 4, 2024
1 parent 118da0e commit a9e577d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/era_verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub const MERGE_BLOCK: usize = 15537394;
/// verifies flat flies stored in directory against a header accumulator
///
pub async fn verify_eras(
store_url: &String,
store_url: String,
macc: MasterAccumulator,
start_epoch: usize,
end_epoch: Option<usize>,
Expand All @@ -27,7 +27,7 @@ pub async fn verify_eras(
for epoch in start_epoch..=end_epoch.unwrap_or(start_epoch + 1) {
let tx = tx.clone();
let store_url = store_url.clone();
let decompress = decompress.clone();
let decompress = decompress;
let macc = macc.clone();

task::spawn(async move {
Expand Down Expand Up @@ -72,7 +72,7 @@ pub async fn verify_eras(

async fn get_blocks_from_store(
epoch: usize,
store_url: &String,
store_url: &str,
decompress: Option<bool>,
) -> Result<Vec<Block>, anyhow::Error> {
let start_100_block = epoch * MAX_EPOCH_SIZE;
Expand All @@ -91,7 +91,7 @@ async fn get_blocks_from_store(
}

async fn extract_100s_blocks(
store_url: &String,
store_url: &str,
start_block: usize,
end_block: usize,
decompress: Option<bool>,
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ async fn main() {
};

match verify_eras(
store_url,
store_url.to_string(),
macc.unwrap(),
*start_epoch,
*end_epoch,
Expand Down
4 changes: 2 additions & 2 deletions src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub fn new<S: AsRef<str>>(store_url: S) -> Result<Store, anyhow::Error> {

Ok(Store {
store: Arc::new(store),
base: match path.starts_with("/") {
base: match path.starts_with('/') {
false => path.to_string(),
true => path[1..].to_string(),
},
Expand All @@ -52,7 +52,7 @@ pub fn new<S: AsRef<str>>(store_url: S) -> Result<Store, anyhow::Error> {

Ok(Store {
store: Arc::new(store),
base: match path.starts_with("/") {
base: match path.starts_with('/') {
false => path.to_string(),
true => path[1..].to_string(),
},
Expand Down

0 comments on commit a9e577d

Please sign in to comment.