Apply suggestions from code review

Co-authored-by: Luc Mcgrady <lucmcgrady@gmail.com>
This commit is contained in:
Jarrett Ye 2025-07-30 15:17:49 +08:00 committed by GitHub
parent 14f9c139d3
commit 4c69989479
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View file

@ -88,7 +88,7 @@ impl RevlogEntry {
/// Returns true if the review entry is not manually rescheduled and not
/// cramming. Used to filter out entries that shouldn't be considered
/// for statistics and scheduling.
pub(crate) fn has_rating_and_affect_scheduling(&self) -> bool {
pub(crate) fn has_rating_and_affects_scheduling(&self) -> bool {
// not rescheduled/set due date/reset
self.button_chosen > 0
// not cramming

View file

@ -323,7 +323,7 @@ pub(crate) fn get_last_revlog_info(revlogs: &[RevlogEntry]) -> HashMap<CardId, L
.for_each(|(card_id, group)| {
let mut last_reviewed_at = None;
for e in group.into_iter() {
if e.has_rating_and_affect_scheduling() {
if e.has_rating_and_affects_scheduling() {
last_reviewed_at = Some(e.id.as_secs());
}
}

View file

@ -53,7 +53,7 @@ impl GraphsContext {
self.revlog
.iter()
.filter(|review| {
review.has_rating_and_affect_scheduling()
review.has_rating_and_affects_scheduling()
// cards with an interval ≥ 1 day
&& (review.review_kind == RevlogReviewKind::Review
|| review.last_interval <= -86400