Skip to content

Commit

Permalink
chore(clippy): fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mendez committed Feb 21, 2024
1 parent 7932600 commit 46ebeed
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 27 deletions.
3 changes: 1 addition & 2 deletions spider/src/page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1223,8 +1223,7 @@ impl Page {

#[cfg(test)]
#[cfg(all(not(feature = "decentralized"), not(feature = "cache")))]
const TEST_AGENT_NAME: &'static str =
concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION"));
const TEST_AGENT_NAME: &str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION"));

#[cfg(all(
feature = "headers",
Expand Down
44 changes: 19 additions & 25 deletions spider/src/website.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ pub struct Website {
impl Website {
/// Initialize Website object with a start link to crawl.
pub fn new(url: &str) -> Self {
let url = if url.starts_with(" ") || url.ends_with(" ") {
let url = if url.starts_with(' ') || url.ends_with(' ') {
url.trim()
} else {
url
Expand Down Expand Up @@ -1594,10 +1594,9 @@ impl Website {
self.crawl_concurrent(&client, &handle).await;
self.sitemap_crawl_chain(&client, &handle, false).await;
self.set_crawl_status();
match join_handle {
Some(h) => h.abort(),
_ => (),
};
if let Some(h) = join_handle {
h.abort()
}
self.client.replace(client);
}

Expand All @@ -1611,10 +1610,9 @@ impl Website {
};
self.sitemap_crawl(&client, &handle, false).await;
self.set_crawl_status();
match join_handle {
Some(h) => h.abort(),
_ => (),
};
if let Some(h) = join_handle {
h.abort()
}
self.client.replace(client);
}

Expand All @@ -1629,10 +1627,9 @@ impl Website {
};
self.crawl_concurrent_smart(&client, &handle).await;
self.set_crawl_status();
match join_handle {
Some(h) => h.abort(),
_ => (),
};
if let Some(h) = join_handle {
h.abort()
}
self.client.replace(client);
}

Expand All @@ -1653,10 +1650,9 @@ impl Website {
self.crawl_concurrent_raw(&client, &handle).await;
self.sitemap_crawl_chain(&client, &handle, false).await;
self.set_crawl_status();
match join_handle {
Some(h) => h.abort(),
_ => (),
};
if let Some(h) = join_handle {
h.abort()
}
self.client.replace(client);
}

Expand All @@ -1671,10 +1667,9 @@ impl Website {
self.scrape_concurrent(&client, &handle).await;
self.sitemap_crawl_chain(&client, &handle, true).await;
self.set_crawl_status();
match join_handle {
Some(h) => h.abort(),
_ => (),
};
if let Some(h) = join_handle {
h.abort()
}
self.client.replace(client);
}

Expand All @@ -1689,10 +1684,9 @@ impl Website {
self.scrape_concurrent_raw(&client, &handle).await;
self.sitemap_crawl_chain(&client, &handle, true).await;
self.set_crawl_status();
match join_handle {
Some(h) => h.abort(),
_ => (),
};
if let Some(h) = join_handle {
h.abort()
}
self.client.replace(client);
}

Expand Down

0 comments on commit 46ebeed

Please sign in to comment.