diff --git a/lykiadb-lang/src/parser/mod.rs b/lykiadb-lang/src/parser/mod.rs index b3577a9..81db576 100644 --- a/lykiadb-lang/src/parser/mod.rs +++ b/lykiadb-lang/src/parser/mod.rs @@ -1111,13 +1111,12 @@ impl Parser<'_> { (None, false) }; - if second_expr.is_some() && reverse { - Some(SqlLimitClause { + match (&second_expr, reverse) { + (Some(_), true) => Some(SqlLimitClause { count: second_expr.unwrap(), offset: Some(first_expr), - }) - } else { - Some(SqlLimitClause { + }), + _ => Some(SqlLimitClause { count: first_expr, offset: second_expr, })