Skip to content

Commit cc62a92

Browse files
committed
store: Use exhaustive match in relational_queries::Limit.single_limit
1 parent 405b38e commit cc62a92

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

store/postgres/src/relational_queries.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,9 +1410,15 @@ impl<'a> ParentLimit<'a> {
14101410
/// Include a 'limit {num_parents}+1' clause for single-object queries
14111411
/// if that is needed
14121412
fn single_limit(&self, num_parents: usize, out: &mut AstPass<Pg>) {
1413-
if let ParentLimit::Ranked(_, _) = self {
1414-
out.push_sql(" limit ");
1415-
out.push_sql(&(num_parents + 1).to_string());
1413+
match self {
1414+
ParentLimit::Ranked(_, _) => {
1415+
out.push_sql(" limit ");
1416+
out.push_sql(&(num_parents + 1).to_string());
1417+
}
1418+
ParentLimit::Outer => {
1419+
// limiting is taken care of in a wrapper around
1420+
// the query we are currently building
1421+
}
14161422
}
14171423
}
14181424
}

0 commit comments

Comments
 (0)