From 00a8f985937d8e75d375d6d58bcc17aff157a1ac Mon Sep 17 00:00:00 2001 From: Bugen Zhao Date: Thu, 9 Nov 2023 16:56:07 +0800 Subject: [PATCH] use empty_results Signed-off-by: Bugen Zhao --- sqllogictest/src/parser.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/sqllogictest/src/parser.rs b/sqllogictest/src/parser.rs index 5d11a5b..ac2f5ab 100644 --- a/sqllogictest/src/parser.rs +++ b/sqllogictest/src/parser.rs @@ -93,8 +93,8 @@ pub enum QueryExpect { Error(ExpectedError), } -#[cfg(test)] impl QueryExpect { + /// Creates a new [`QueryExpect`] with empty results. fn empty_results() -> Self { Self::Results { types: Vec::new(), @@ -749,12 +749,7 @@ fn parse_inner(loc: &Location, script: &str) -> Result QueryExpect::Results { - types: Vec::new(), - sort_mode: None, - label: None, - results: Vec::new(), - }, + [] => QueryExpect::empty_results(), }; // The SQL for the query is found on second an subsequent lines of the record