Skip to content

Commit

Permalink
Fix new clippy lints (#289)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinmr authored Nov 21, 2023
1 parent 5ac2f22 commit a128763
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/scheduler/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,8 @@ impl ScoreCache {
};

// Update the cache with a valid score.
if score.is_ok() {
self.lesson_cache
.borrow_mut()
.insert(*lesson_id, *score.as_ref().unwrap());
if let Ok(score) = score {
self.lesson_cache.borrow_mut().insert(*lesson_id, score);
}
score
}
Expand Down Expand Up @@ -337,10 +335,8 @@ impl ScoreCache {
};

// Update the cache with a valid score.
if score.is_ok() {
self.course_cache
.borrow_mut()
.insert(*course_id, *score.as_ref().unwrap());
if let Ok(score) = score {
self.course_cache.borrow_mut().insert(*course_id, score);
}
score
}
Expand Down

0 comments on commit a128763

Please sign in to comment.