Skip to content

Commit

Permalink
Clippy suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Quantumplation committed Apr 30, 2024
1 parent e9cc93c commit 437cf20
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions examples/crawler/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ async fn block_matches<'a>(block: &MultiEraBlock<'a>) -> bool {
// An arbitrary predicate to decide whether to save the transaction or not;
// fill in with your own purpose built logic
async fn tx_matches<'a>(_tx: &MultiEraTx<'a>) -> bool {
return false;
false
}

#[tokio::main]
async fn main() -> Result<()> {
let args = Args::parse();

// Connect to the local node over the file socket
let mut client = NodeClient::connect(args.socket_path.clone(), args.network_magic.clone())
let mut client = NodeClient::connect(args.socket_path.clone(), args.network_magic)
.await
.unwrap();

Expand Down Expand Up @@ -98,10 +98,10 @@ struct Args {
}

impl Args {
pub fn tx_path(self: &Self, tx: &MultiEraTx) -> String {
pub fn tx_path(&self, tx: &MultiEraTx) -> String {
format!("{}/txs/{}.cbor", self.out.to_str().unwrap(), tx.hash())
}
pub fn block_path(self: &Self, block: &MultiEraBlock) -> String {
pub fn block_path(&self, block: &MultiEraBlock) -> String {
format!(
"{}/blocks/{}.cbor",
self.out.to_str().unwrap(),
Expand All @@ -114,7 +114,7 @@ pub fn parse_point(s: &str) -> Result<Point, Box<dyn std::error::Error + Send +
if s == "origin" {
return std::result::Result::Ok(Point::Origin);
}
let parts: Vec<_> = s.split("/").collect();
let parts: Vec<_> = s.split('/').collect();
let slot = parts[0].parse()?;
let hash = hex::decode(parts[1])?;
std::result::Result::Ok(Point::Specific(slot, hash))
Expand Down

0 comments on commit 437cf20

Please sign in to comment.