Skip to content

Commit

Permalink
Fix build failure
Browse files Browse the repository at this point in the history
  • Loading branch information
douweschulte committed Sep 11, 2024
1 parent 5ed6b1a commit 4cdf624
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
8 changes: 4 additions & 4 deletions examples/multi-annotator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ fn main() {
if args.charge_independent_Y {
let unique_Y = fragments
.iter()
.filter_map(|frag| {
if let FragmentType::Y(pos) = &frag.ion {
.filter_map(|fragment| {
if let FragmentType::Y(pos) = &fragment.ion {
Some(pos)
} else {
None
Expand All @@ -110,8 +110,8 @@ fn main() {
let unique_Y_found = annotated
.spectrum()
.flat_map(|peak| &peak.annotation)
.filter_map(|(frag, _)| {
if let FragmentType::Y(pos) = &frag.ion {
.filter_map(|fragment| {
if let FragmentType::Y(pos) = &fragment.ion {
Some(pos)
} else {
None
Expand Down
2 changes: 1 addition & 1 deletion rustyms-py/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1312,7 +1312,7 @@ impl AnnotatedPeak {
self.0
.annotation
.iter()
.map(|x| Fragment(x.0.clone()))
.map(|x| Fragment(x.clone()))
.collect()
}
}
Expand Down
4 changes: 1 addition & 3 deletions rustyms/src/spectrum/fragmentation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ pub trait AnnotatableSpectrum {

// Get the index of the element closest to this value
if let Some(index) = Self::search(self, mz, tolerance) {
annotated.spectrum[index]
.annotation
.push((fragment.clone(), Vec::new()));
annotated.spectrum[index].annotation.push(fragment.clone());
}
}

Expand Down
10 changes: 5 additions & 5 deletions rustyms/src/spectrum/scores.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ impl AnnotatedSpectrum {
let number = p
.annotation
.iter()
.filter(|(a, _)| {
.filter(|a| {
peptidoform_index.map_or(true, |i| a.peptidoform_index == i)
&& peptide_index.map_or(true, |i| a.peptide_index == i)
&& ion.map_or(true, |kind| a.ion.kind() == kind)
Expand Down Expand Up @@ -147,12 +147,12 @@ impl AnnotatedSpectrum {
.flat_map(|p| {
p.annotation
.iter()
.filter(|(a, _)| {
.filter(|a| {
a.peptidoform_index == peptidoform_index
&& a.peptide_index == peptide_index
&& ion.map_or(true, |kind| a.ion.kind() == kind)
})
.filter_map(|(a, _)| a.ion.position())
.filter_map(|a| a.ion.position())
})
.map(|pos| pos.sequence_index)
.unique()
Expand Down Expand Up @@ -181,12 +181,12 @@ impl AnnotatedSpectrum {
.spectrum
.iter()
.flat_map(|p| {
p.annotation.iter().filter(|(a, _)| {
p.annotation.iter().filter(|a| {
peptide_index.map_or(true, |i| a.peptide_index == i)
&& ion.map_or(true, |kind| a.ion.kind() == kind)
})
})
.map(|(f, _)| f.formula.clone())
.map(|f| f.formula.clone())
.unique()
.count() as u32;
let total_fragments = fragments
Expand Down

0 comments on commit 4cdf624

Please sign in to comment.