Skip to content

Commit

Permalink
make clippy happy
Browse files Browse the repository at this point in the history
Signed-off-by: Nico Wagner <[email protected]>
  • Loading branch information
nwagner84 committed Sep 2, 2024
1 parent 4a395e7 commit d75762f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions crates/pica-format/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ impl Formatter for Value {
subfield: &SubfieldRef,
options: &FormatOptions,
) -> String {
if !self.codes.contains(&subfield.code()) {
if !self.codes.contains(subfield.code()) {
return "".into();
}

Expand Down Expand Up @@ -164,7 +164,7 @@ impl Formatter for Value {
let mut cnt = 0;

for subfield in field.subfields().iter() {
if !self.codes.contains(&subfield.code()) {
if !self.codes.contains(subfield.code()) {
continue;
}

Expand Down
10 changes: 5 additions & 5 deletions crates/pica-matcher/src/subfield_matcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fn parse_subfield_code_range(
.verify(|(min, max)| min < max)
.map(|(min, max)| {
(min.as_byte()..=max.as_byte())
.map(|code| SubfieldCode::from_unchecked(code))
.map(SubfieldCode::from_unchecked)
.collect()
})
.parse_next(i)
Expand Down Expand Up @@ -181,7 +181,7 @@ impl ExistsMatcher {
) -> bool {
subfields
.into_iter()
.any(|subfield| self.codes.contains(&subfield.code()))
.any(|subfield| self.codes.contains(subfield.code()))
}
}

Expand Down Expand Up @@ -255,7 +255,7 @@ impl RelationMatcher {

let mut subfields = subfields
.into_iter()
.filter(|s| self.codes.contains(&s.code()));
.filter(|s| self.codes.contains(s.code()));

let check = |subfield: &SubfieldRef| -> bool {
let value = subfield.value().as_ref();
Expand Down Expand Up @@ -485,7 +485,7 @@ impl RegexMatcher {

let mut subfields = subfields
.into_iter()
.filter(|s| self.codes.contains(&s.code()));
.filter(|s| self.codes.contains(s.code()));

let check_fn = |subfield: &SubfieldRef| -> bool {
let mut result = re.is_match(subfield.value().as_ref());
Expand Down Expand Up @@ -629,7 +629,7 @@ impl InMatcher {
) -> bool {
let mut subfields = subfields
.into_iter()
.filter(|s| self.codes.contains(&s.code()));
.filter(|s| self.codes.contains(s.code()));

let check_fn = |subfield: &SubfieldRef| -> bool {
let mut result = self.values.iter().any(|rhs| {
Expand Down
4 changes: 2 additions & 2 deletions crates/pica-path/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ fn parse_subfield_code_range(
.verify(|(min, max)| min < max)
.map(|(min, max)| {
(min.as_byte()..=max.as_byte())
.map(|code| SubfieldCode::from_unchecked(code))
.map(SubfieldCode::from_unchecked)
.collect()
})
.parse_next(i)
Expand Down Expand Up @@ -361,7 +361,7 @@ impl<'a> PathExt for RecordRef<'a> {
})
.flat_map(FieldRef::subfields)
.filter_map(|subfield| {
if path.codes_flat().contains(&subfield.code()) {
if path.codes_flat().contains(subfield.code()) {
Some(subfield.value())
} else {
None
Expand Down
2 changes: 1 addition & 1 deletion crates/pica-select/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ impl QueryExt for RecordRef<'_> {
.iter()
.filter(|subfield| {
codes.contains(
&subfield.code(),
subfield.code(),
)
})
.map(|subfield| {
Expand Down

0 comments on commit d75762f

Please sign in to comment.