Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
brentp committed Dec 4, 2023
1 parent 0e488e6 commit 853071a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/bedder_vcf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,12 @@ impl Positioned for vcf::record::Record {
}

fn set_start(&mut self, start: u64) {
let mut p = self.position_mut();
let p = self.position_mut();
*p = vcf::record::Position::try_from((start + 1) as usize)
.expect("error setting start position in vcf record");
}

fn set_stop(&mut self, stop: u64) {
fn set_stop(&mut self, _stop: u64) {
// set_stop in vcf is currently a no-op
}

Expand Down
15 changes: 7 additions & 8 deletions src/intersections.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::intersection::{Intersection, Intersections};
use crate::position::{Position, Positioned};
use crate::intersection::Intersections;
use crate::position::Position;
use bitflags::bitflags;

pub enum IntersectionOutput {
Expand Down Expand Up @@ -77,6 +77,7 @@ impl Intersections {
#[cfg(test)]
mod tests {
use super::*;
use crate::intersection::Intersection;
use crate::interval::Interval;
use std::sync::Arc;

Expand Down Expand Up @@ -127,16 +128,14 @@ mod tests {

// clip a.start, end
let interval = intersections.base_interval.clone();
eprintln!("overlapping: {:?}", intersections.overlapping);
let mut pieces = vec![];
intersections.overlapping.iter().for_each(|o| {
let mut piece: Position = interval.as_ref().dup();
if piece.start() > o.interval.start() {
piece.set_start(o.interval.start());
}
if piece.stop() > o.interval.stop() {
piece.set_stop(o.interval.stop());
}
piece.set_start(o.interval.start().max(piece.start()));
piece.set_stop(o.interval.stop().min(piece.stop()));
pieces.push(piece)
});
eprintln!("pieces: {:?}", pieces);
}
}

0 comments on commit 853071a

Please sign in to comment.