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

View File

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