From 9b742e1a767198e7657ca689308c64c99afda6fc Mon Sep 17 00:00:00 2001 From: PThorpe92 Date: Mon, 17 Feb 2025 21:31:27 -0500 Subject: [PATCH] Remove clone in vtab from_args --- core/lib.rs | 4 ++-- core/translate/planner.rs | 7 +++++-- core/vdbe/mod.rs | 2 +- testing/cli_tests/cli_test_cases.py | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/core/lib.rs b/core/lib.rs index f1ddcc08c..267520d20 100644 --- a/core/lib.rs +++ b/core/lib.rs @@ -532,7 +532,7 @@ impl VirtualTable { args: Vec, syms: &SymbolTable, kind: VTabKind, - exprs: &Option>, + exprs: Option>, ) -> Result> { let module = syms .vtab_modules @@ -559,7 +559,7 @@ impl VirtualTable { name: tbl_name.unwrap_or(module_name).to_owned(), implementation: module.implementation.clone(), columns, - args: exprs.clone(), + args: exprs, }); return Ok(vtab); } diff --git a/core/translate/planner.rs b/core/translate/planner.rs index 440744426..84057d1e6 100644 --- a/core/translate/planner.rs +++ b/core/translate/planner.rs @@ -376,9 +376,12 @@ fn parse_from_clause_table<'a>( .push(TableReference::new_subquery(identifier, subplan, None)); Ok(()) } - ast::SelectTable::TableCall(qualified_name, ref maybe_args, maybe_alias) => { + ast::SelectTable::TableCall(qualified_name, maybe_args, maybe_alias) => { let normalized_name = &normalize_ident(qualified_name.name.0.as_str()); - let args = vtable_args(maybe_args.as_ref().unwrap_or(&vec![]).as_slice()); + let args = match maybe_args { + Some(ref args) => vtable_args(args), + None => vec![], + }; let vtab = crate::VirtualTable::from_args( None, normalized_name, diff --git a/core/vdbe/mod.rs b/core/vdbe/mod.rs index a45ea199c..2c7566628 100644 --- a/core/vdbe/mod.rs +++ b/core/vdbe/mod.rs @@ -906,7 +906,7 @@ impl Program { args, &conn.db.syms.borrow(), limbo_ext::VTabKind::VirtualTable, - &None, + None, )?; { conn.db diff --git a/testing/cli_tests/cli_test_cases.py b/testing/cli_tests/cli_test_cases.py index 6eb1106f2..caaf730a4 100755 --- a/testing/cli_tests/cli_test_cases.py +++ b/testing/cli_tests/cli_test_cases.py @@ -142,7 +142,7 @@ def test_output_file(): expected_lines = { f"Output: {output_filename}": "Can direct output to a file", - "Output mode: raw": "Output mode remains raw when output is redirected", + "Output mode: list": "Output mode remains list when output is redirected", "Error: pretty output can only be written to a tty": "Error message for pretty mode", "SELECT 'TEST_ECHO'": "Echoed command", "TEST_ECHO": "Echoed result",