Rename prop:order to prop:pos

This commit is contained in:
abdo 2021-01-02 13:35:10 +03:00
parent 0ad4619833
commit dc51dc6795
2 changed files with 6 additions and 6 deletions

View File

@ -97,7 +97,7 @@ pub(super) enum PropertyKind {
Reps(u32),
Lapses(u32),
Ease(f32),
Order(u32),
Position(u32),
}
#[derive(Debug, PartialEq)]
@ -374,7 +374,7 @@ fn parse_prop(val: &str) -> ParseResult<SearchNode<'static>> {
tag("reps"),
tag("lapses"),
tag("ease"),
tag("order"),
tag("pos"),
))(val)?;
let (val, operator) = alt((
@ -398,7 +398,7 @@ fn parse_prop(val: &str) -> ParseResult<SearchNode<'static>> {
"ivl" => PropertyKind::Interval(num),
"reps" => PropertyKind::Reps(num),
"lapses" => PropertyKind::Lapses(num),
"order" => PropertyKind::Order(num),
"pos" => PropertyKind::Position(num),
_ => unreachable!(),
}
};

View File

@ -247,13 +247,13 @@ impl SqlWriter<'_> {
day = day
)
}
PropertyKind::Order(order) => {
PropertyKind::Position(pos) => {
write!(
self.sql,
"(c.type = {t} and due {op} {order})",
"(c.type = {t} and due {op} {pos})",
t = CardType::New as u8,
op = op,
order = order
pos = pos
)
}
PropertyKind::Interval(ivl) => write!(self.sql, "ivl {} {}", op, ivl),