Skip to content

Commit

Permalink
Apply suggestions
Browse files Browse the repository at this point in the history
Co-authored-by: Matthias Endler <[email protected]>
  • Loading branch information
Techassi and mre authored Jul 17, 2023
1 parent 8528b8a commit 5e58638
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lychee-lib/src/types/accept/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl AcceptRange {
self.0.end()
}

/// Returns wether this [`AcceptRange`] contains `value`.
/// Returns whether this [`AcceptRange`] contains `value`.
pub fn contains(&self, value: usize) -> bool {
self.0.contains(&value)
}
Expand Down
12 changes: 3 additions & 9 deletions lychee-lib/src/types/accept/selector.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::types::accept::AcceptRange;

/// A [`AcceptSelector`] determines if a returned HTTP status code should be
/// An [`AcceptSelector`] determines if a returned HTTP status code should be
/// accepted and thus counted as a valid (not broken) link.
#[derive(Debug)]
pub struct AcceptSelector {
Expand Down Expand Up @@ -40,15 +40,9 @@ impl AcceptSelector {
self
}

/// Returns wether this [`AcceptSelector`] contains `value`.
/// Returns whether this [`AcceptSelector`] contains `value`.
pub fn contains(&self, value: usize) -> bool {
for range in &self.ranges {
if range.contains(value) {
return true;
}
}

false
self.ranges.iter().any(|range| range.contains(value))
}

pub(crate) fn len(&self) -> usize {
Expand Down

0 comments on commit 5e58638

Please sign in to comment.