mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Remove coercion in write_rated
This commit is contained in:
parent
87bc1e69b0
commit
8f01887fe7
2 changed files with 2 additions and 3 deletions
|
@ -320,7 +320,7 @@ fn parse_added(s: &str) -> ParseResult<SearchNode<'static>> {
|
||||||
fn parse_edited(s: &str) -> ParseResult<SearchNode<'static>> {
|
fn parse_edited(s: &str) -> ParseResult<SearchNode<'static>> {
|
||||||
let n: u32 = s.parse()?;
|
let n: u32 = s.parse()?;
|
||||||
let days = n.max(1);
|
let days = n.max(1);
|
||||||
Ok(SearchNode::EditedInDays(n))
|
Ok(SearchNode::EditedInDays(days))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// eg is:due
|
/// eg is:due
|
||||||
|
|
|
@ -216,8 +216,7 @@ impl SqlWriter<'_> {
|
||||||
|
|
||||||
fn write_rated(&mut self, days: u32, ease: Option<u8>) -> Result<()> {
|
fn write_rated(&mut self, days: u32, ease: Option<u8>) -> Result<()> {
|
||||||
let today_cutoff = self.col.timing_today()?.next_day_at;
|
let today_cutoff = self.col.timing_today()?.next_day_at;
|
||||||
let days = days.min(365) as i64;
|
let target_cutoff_ms = (today_cutoff - 86_400 * i64::from(days)) * 1_000;
|
||||||
let target_cutoff_ms = (today_cutoff - 86_400 * days) * 1_000;
|
|
||||||
write!(
|
write!(
|
||||||
self.sql,
|
self.sql,
|
||||||
"c.id in (select cid from revlog where id>{}",
|
"c.id in (select cid from revlog where id>{}",
|
||||||
|
|
Loading…
Reference in a new issue