From a5947e5c65420d16ac57ea48de90996cf6310afb Mon Sep 17 00:00:00 2001 From: Henrik Giesel Date: Mon, 18 Jan 2021 23:27:57 +0100 Subject: [PATCH] Satisfy formatter --- rslib/src/config.rs | 1 - rslib/src/stats/graphs.rs | 1 - ts/graphs/calendar.ts | 26 +++++++++++++++++--------- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/rslib/src/config.rs b/rslib/src/config.rs index 8e8c0f9f3..9a90b1069 100644 --- a/rslib/src/config.rs +++ b/rslib/src/config.rs @@ -230,7 +230,6 @@ impl Collection { self.set_config(ConfigKey::NewReviewMix, &(mix as u8)) } - pub(crate) fn get_first_weekday(&self) -> Weekday { match self.get_config_default::(ConfigKey::FirstWeekday) { 1 => Weekday::Monday, diff --git a/rslib/src/stats/graphs.rs b/rslib/src/stats/graphs.rs index 90f3139ea..59243e13f 100644 --- a/rslib/src/stats/graphs.rs +++ b/rslib/src/stats/graphs.rs @@ -25,7 +25,6 @@ impl Collection { let offset = self.local_utc_offset_for_user()?; let local_offset_secs = offset.local_minus_utc() as i64; - let cards = self.storage.all_searched_cards()?; let revlog = if all { self.storage.get_all_revlog_entries(revlog_start)? diff --git a/ts/graphs/calendar.ts b/ts/graphs/calendar.ts index 58e33d64d..a5b1deb23 100644 --- a/ts/graphs/calendar.ts +++ b/ts/graphs/calendar.ts @@ -13,14 +13,21 @@ import { select, mouse } from "d3-selection"; import { scaleLinear, scaleSequential } from "d3-scale"; import { showTooltip, hideTooltip } from "./tooltip"; import { GraphBounds, setDataAvailable, RevlogRange } from "./graph-helpers"; -import { timeDay, timeYear, timeSunday, timeMonday, timeFriday, timeSaturday } from "d3-time"; +import { + timeDay, + timeYear, + timeSunday, + timeMonday, + timeFriday, + timeSaturday, +} from "d3-time"; import type { CountableTimeInterval } from "d3-time"; import type { I18n } from "anki/i18n"; export interface GraphData { // indexed by day, where day is relative to today reviewCount: Map; - timeFunction: CountableTimeInterval, + timeFunction: CountableTimeInterval; } interface DayDatum { @@ -47,13 +54,14 @@ export function gatherData(data: pb.BackendProto.GraphsOut): GraphData { reviewCount.set(day, count + 1); } - let timeFunction = data.firstWeekday === 1 - ? timeMonday - : data.firstWeekday === 5 - ? timeFriday - : data.firstWeekday === 6 - ? timeSaturday - : timeSunday; + const timeFunction = + data.firstWeekday === 1 + ? timeMonday + : data.firstWeekday === 5 + ? timeFriday + : data.firstWeekday === 6 + ? timeSaturday + : timeSunday; return { reviewCount, timeFunction }; }