Skip to content

Commit

Permalink
chore(clippy): fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mendez committed Nov 30, 2024
1 parent efa7f3c commit 8bc3ffe
Show file tree
Hide file tree
Showing 17 changed files with 325 additions and 367 deletions.
20 changes: 10 additions & 10 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion spider/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ pub mod black_list {
pub mod black_list {
use crate::compact_str::CompactString;
/// check if link exist in blacklists.
pub fn contains(blacklist_url: &Vec<CompactString>, link: &CompactString) -> bool {
pub fn contains(blacklist_url: &[CompactString], link: &CompactString) -> bool {
blacklist_url.contains(link)
}
}
Expand Down
16 changes: 6 additions & 10 deletions spider/src/packages/robotparser/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,10 @@ impl RuleLine {

#[cfg(not(feature = "regex"))]
fn applies_to(&self, pathname: &str) -> bool {
if self.path == "*" {
true
} else if self.path == "/" && pathname == "/" {
true
} else if self.path.ends_with("/") && pathname.starts_with(&self.path) {
if self.path == "*"
|| self.path == "/" && pathname == "/"
|| self.path.ends_with("/") && pathname.starts_with(&self.path)
{
true
} else {
self.path
Expand Down Expand Up @@ -317,11 +316,8 @@ impl RobotFileParser {
/// Sets the time the robots.txt file was last fetched to the
/// current time.
pub fn modified(&mut self) {
match SystemTime::now().duration_since(UNIX_EPOCH) {
Ok(time) => {
self.last_checked = time.as_secs() as i64;
}
_ => (),
if let Ok(time) = SystemTime::now().duration_since(UNIX_EPOCH) {
self.last_checked = time.as_secs() as i64;
}
}

Expand Down
Loading

0 comments on commit 8bc3ffe

Please sign in to comment.