Skip to content

Commit

Permalink
Fix some clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
hiqua committed Dec 9, 2024
1 parent 57fd812 commit c9c8f24
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/merge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ struct Interval {
}

/// these functions are expensive with sorting and copying
fn are_compatible(a: Vec<&Interval>) -> bool {
let mut s = vec![];
{
Expand All @@ -52,7 +51,7 @@ fn are_compatible(a: Vec<&Interval>) -> bool {
}

for pair in s.windows(2) {
let i1 = pair.get(0).unwrap();
let i1 = pair.first().unwrap();
let i2 = pair.get(1).unwrap();
if i1.end > i2.start {
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ pub fn get_all_life_lapses(
let life_lapses = parse_activities(activities_lines.iter(), config);
all_life_lapses.extend(life_lapses);
}
all_life_lapses.get(0).unwrap().start
all_life_lapses.first().unwrap().start
};

all_life_lapses.sort_by_key(|ll| ll.start);
Expand Down

0 comments on commit c9c8f24

Please sign in to comment.