Fix formatting

This commit is contained in:
Henrik Giesel 2021-01-14 21:01:40 +01:00
parent 88c75d73b6
commit 8f3c63bf0b
2 changed files with 10 additions and 11 deletions

View file

@ -264,22 +264,21 @@ impl SqlWriter<'_> {
days = days
).unwrap()
}
PropertyKind::Position(pos) => {
write!(
PropertyKind::Position(pos) => write!(
self.sql,
"(c.type = {t} and due {op} {pos})",
t = CardType::New as u8,
op = op,
pos = pos
).unwrap()
}
)
.unwrap(),
PropertyKind::Interval(ivl) => write!(self.sql, "ivl {} {}", op, ivl).unwrap(),
PropertyKind::Reps(reps) => write!(self.sql, "reps {} {}", op, reps).unwrap(),
PropertyKind::Lapses(days) => write!(self.sql, "lapses {} {}", op, days).unwrap(),
PropertyKind::Ease(ease) => {
write!(self.sql, "factor {} {}", op, (ease * 1000.0) as u32).unwrap()
}
PropertyKind::Rated(days, ease) => self.write_rated(i64::from(*days), ease, op)?
PropertyKind::Rated(days, ease) => self.write_rated(i64::from(*days), ease, op)?,
}
Ok(())

View file

@ -199,7 +199,7 @@ fn write_property(operator: &str, kind: &PropertyKind) -> String {
EaseKind::AnswerButton(val) => format!("\"prop:rated{}{}:{}\"", operator, u, val),
EaseKind::AnyAnswerButton => format!("\"prop:rated{}{}\"", operator, u),
EaseKind::ManualReschedule => format!("\"prop:resched{}{}\"", operator, u),
}
},
}
}