Skip to content

Commit

Permalink
refactor: apply clippy suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
sameh-farouk committed Sep 12, 2023
1 parent 0773121 commit 845f6e6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/bins/rmb-peer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ fn parse_urls(input: &[String]) -> Result<Vec<url::Url>> {
let mut urls: Vec<url::Url> = Vec::new();

for s in input {
let u: url::Url = url::Url::parse(&s)?;
let u: url::Url = url::Url::parse(s)?;
if u.domain().is_none() {
anyhow::bail!("relay URL must contain a domain name");
}
Expand Down
2 changes: 1 addition & 1 deletion src/relay/federation/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ where
pub fn new(sink: Sink, twins: D, ranker: RelayRanker) -> Self {
Self {
sink: Some(sink),
twins: twins,
twins,
ranker,
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/relay/ranker/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl RelayStats {
retain.saturating_add(Duration::from_secs(1))
}) < retain
});
log::trace!("cleaning {:?} entires", count - &self.failure_times.len());
log::trace!("cleaning {:?} entires", count - self.failure_times.len());
}

fn add_failure(&mut self, retain: Duration) {
Expand All @@ -50,7 +50,7 @@ impl RelayStats {
}
count += 1;
}
Ok(&self.failure_times.len() - count)
Ok(self.failure_times.len() - count)
}

/// Return the mean failure rate per hour based on the known failures happened during the specified recent period.
Expand Down

0 comments on commit 845f6e6

Please sign in to comment.