From 3db585c52145cc39a089e1648f8a4918cf44292d Mon Sep 17 00:00:00 2001 From: Josh Pschorr Date: Wed, 13 Mar 2024 14:39:36 -0700 Subject: [PATCH] Fix errors reported by lint `#![deny(rust_2018_idioms)]` --- .../src/lib.rs | 8 +- extension/partiql-extension-ion/src/encode.rs | 2 - .../src/ast_to_dot.rs | 76 +++++++++---------- .../src/plan_to_dot.rs | 4 +- partiql-catalog/src/context.rs | 4 +- partiql-catalog/src/lib.rs | 10 +-- partiql-conformance-tests/tests/mod.rs | 2 +- partiql-eval/src/env.rs | 2 +- partiql-eval/src/error.rs | 2 +- partiql-eval/src/eval/eval_expr_wrapper.rs | 4 +- partiql-eval/src/eval/evaluable.rs | 40 +++++----- partiql-eval/src/eval/expr/coll.rs | 2 +- partiql-eval/src/eval/expr/path.rs | 4 +- partiql-logical-planner/src/lib.rs | 6 +- partiql-logical-planner/src/typer.rs | 8 +- partiql-parser/src/error.rs | 2 +- partiql-parser/src/lexer.rs | 4 +- partiql-parser/src/parse/mod.rs | 9 ++- partiql-parser/src/parse/parse_util.rs | 2 +- partiql-parser/src/preprocessor.rs | 6 +- partiql-parser/src/token_parser.rs | 5 +- partiql-value/src/bag.rs | 2 +- partiql-value/src/lib.rs | 18 ++--- partiql-value/src/list.rs | 2 +- partiql-value/src/tuple.rs | 10 +-- partiql/src/lib.rs | 4 +- partiql/tests/extension_error.rs | 4 +- partiql/tests/user_context.rs | 4 +- 28 files changed, 124 insertions(+), 122 deletions(-) diff --git a/extension/partiql-extension-ion-functions/src/lib.rs b/extension/partiql-extension-ion-functions/src/lib.rs index f3a64225..1cc89843 100644 --- a/extension/partiql-extension-ion-functions/src/lib.rs +++ b/extension/partiql-extension-ion-functions/src/lib.rs @@ -103,7 +103,7 @@ pub(crate) struct EvalFnReadIon {} impl BaseTableExpr for EvalFnReadIon { fn evaluate<'c>( &self, - args: &[Cow], + args: &[Cow<'_, Value>], _ctx: &'c dyn SessionContext<'c>, ) -> BaseTableExprResult<'c> { if let Some(arg1) = args.first() { @@ -155,7 +155,7 @@ fn parse_ion_buff<'a, I: 'a + ToIonDataSource>(input: I) -> BaseTableExprResult< let decoder = IonDecoderBuilder::new(IonDecoderConfig::default().with_mode(Encoding::Ion)).build(reader); let decoder = decoder.map_err(err_map)?.map(move |it| it.map_err(err_map)); - Ok(Box::new(decoder) as BaseTableExprResultValueIter) + Ok(Box::new(decoder) as BaseTableExprResultValueIter<'_>) } #[cfg(test)] @@ -172,7 +172,7 @@ mod tests { #[track_caller] #[inline] - pub(crate) fn parse(statement: &str) -> ParserResult { + pub(crate) fn parse(statement: &str) -> ParserResult<'_> { partiql_parser::Parser::default().parse(statement) } @@ -180,7 +180,7 @@ mod tests { #[inline] pub(crate) fn lower( catalog: &dyn Catalog, - parsed: &Parsed, + parsed: &Parsed<'_>, ) -> partiql_logical::LogicalPlan { let planner = partiql_logical_planner::LogicalPlanner::new(catalog); planner.lower(parsed).expect("lower") diff --git a/extension/partiql-extension-ion/src/encode.rs b/extension/partiql-extension-ion/src/encode.rs index 5c9ee3b7..fba11eec 100644 --- a/extension/partiql-extension-ion/src/encode.rs +++ b/extension/partiql-extension-ion/src/encode.rs @@ -179,7 +179,6 @@ where struct SimpleIonValueEncoder<'a, W, I> where - W: 'a, I: IonWriter, { pub(crate) writer: &'a mut I, @@ -311,7 +310,6 @@ where struct PartiqlEncodedIonValueEncoder<'a, W, I> where - W: 'a, I: IonWriter, { inner: SimpleIonValueEncoder<'a, W, I>, diff --git a/extension/partiql-extension-visualize/src/ast_to_dot.rs b/extension/partiql-extension-visualize/src/ast_to_dot.rs index 7ae4d67b..3d80a3fe 100644 --- a/extension/partiql-extension-visualize/src/ast_to_dot.rs +++ b/extension/partiql-extension-visualize/src/ast_to_dot.rs @@ -43,11 +43,11 @@ impl<'d, 'w> ScopeExt<'d, 'w> for Scope<'d, 'w> { } trait ChildEdgeExt { - fn edges(self, out: &mut Scope, from: &NodeId, lbl: &str) -> Targets; + fn edges(self, out: &mut Scope<'_, '_>, from: &NodeId, lbl: &str) -> Targets; } impl ChildEdgeExt for Targets { - fn edges(self, out: &mut Scope, from: &NodeId, lbl: &str) -> Targets { + fn edges(self, out: &mut Scope<'_, '_>, from: &NodeId, lbl: &str) -> Targets { for target in &self { out.edge(from, target).attributes().set_label(lbl); } @@ -96,14 +96,14 @@ where } trait ToDot { - fn to_dot(&mut self, out: &mut Scope, ast: &T) -> Targets; + fn to_dot(&mut self, out: &mut Scope<'_, '_>, ast: &T) -> Targets; } impl ToDot> for AstToDot where AstToDot: ToDot, { - fn to_dot(&mut self, out: &mut Scope, ast: &Box) -> Targets { + fn to_dot(&mut self, out: &mut Scope<'_, '_>, ast: &Box) -> Targets { self.to_dot(out, &**ast) } } @@ -112,7 +112,7 @@ impl ToDot> for AstToDot where AstToDot: ToDot, { - fn to_dot(&mut self, out: &mut Scope, asts: &Vec) -> Targets { + fn to_dot(&mut self, out: &mut Scope<'_, '_>, asts: &Vec) -> Targets { let mut res = Vec::with_capacity(asts.len()); for ast in asts { res.extend(self.to_dot(out, ast)); @@ -125,7 +125,7 @@ impl ToDot> for AstToDot where AstToDot: ToDot, { - fn to_dot(&mut self, out: &mut Scope, ast: &Option) -> Targets { + fn to_dot(&mut self, out: &mut Scope<'_, '_>, ast: &Option) -> Targets { match ast { None => vec![], Some(ast) => self.to_dot(out, ast), @@ -137,13 +137,13 @@ impl ToDot> for AstToDot where AstToDot: ToDot, { - fn to_dot(&mut self, out: &mut Scope, ast: &ast::AstNode) -> Targets { + fn to_dot(&mut self, out: &mut Scope<'_, '_>, ast: &ast::AstNode) -> Targets { self.to_dot(out, &ast.node) } } impl ToDot for AstToDot { - fn to_dot(&mut self, out: &mut Scope, ast: &ast::Expr) -> Targets { + fn to_dot(&mut self, out: &mut Scope<'_, '_>, ast: &ast::Expr) -> Targets { let mut expr_subgraph = out.subgraph(); use ast::Expr; @@ -240,7 +240,7 @@ fn type_to_str(ty: &ast::Type) -> String { } impl ToDot for AstToDot { - fn to_dot(&mut self, out: &mut Scope, ast: &ast::Lit) -> Targets { + fn to_dot(&mut self, out: &mut Scope<'_, '_>, ast: &ast::Lit) -> Targets { let lbl = lit_to_str(ast); let mut node = out.node_auto(); @@ -251,7 +251,7 @@ impl ToDot for AstToDot { } impl ToDot for AstToDot { - fn to_dot(&mut self, out: &mut Scope, ast: &ast::BinOp) -> Targets { + fn to_dot(&mut self, out: &mut Scope<'_, '_>, ast: &ast::BinOp) -> Targets { use ast::BinOpKind; let lbl = match ast.kind { BinOpKind::Add => "+", @@ -281,7 +281,7 @@ impl ToDot for AstToDot { } impl ToDot for AstToDot { - fn to_dot(&mut self, out: &mut Scope, ast: &ast::UniOp) -> Targets { + fn to_dot(&mut self, out: &mut Scope<'_, '_>, ast: &ast::UniOp) -> Targets { use ast::UniOpKind; let lbl = match ast.kind { UniOpKind::Pos => "+", @@ -297,7 +297,7 @@ impl ToDot for AstToDot { } impl ToDot for AstToDot { - fn to_dot(&mut self, out: &mut Scope, ast: &ast::Like) -> Targets { + fn to_dot(&mut self, out: &mut Scope<'_, '_>, ast: &ast::Like) -> Targets { let id = out.node_auto_labelled("LIKE").id(); self.to_dot(out, &ast.value).edges(out, &id, "value"); @@ -309,7 +309,7 @@ impl ToDot for AstToDot { } impl ToDot for AstToDot { - fn to_dot(&mut self, out: &mut Scope, ast: &ast::Between) -> Targets { + fn to_dot(&mut self, out: &mut Scope<'_, '_>, ast: &ast::Between) -> Targets { let id = out.node_auto_labelled("BETWEEN").id(); self.to_dot(out, &ast.value).edges(out, &id, "value"); @@ -321,7 +321,7 @@ impl ToDot for AstToDot { } impl ToDot for AstToDot { - fn to_dot(&mut self, out: &mut Scope, ast: &ast::In) -> Targets { + fn to_dot(&mut self, out: &mut Scope<'_, '_>, ast: &ast::In) -> Targets { let id = out.node_auto_labelled("IN").id(); self.to_dot(out, &ast.lhs).edges(out, &id, ""); @@ -332,7 +332,7 @@ impl ToDot for AstToDot { } impl ToDot for AstToDot { - fn to_dot(&mut self, out: &mut Scope, ast: &ast::Query) -> Targets { + fn to_dot(&mut self, out: &mut Scope<'_, '_>, ast: &ast::Query) -> Targets { let id = out.node_auto_labelled("Query").id(); self.to_dot(out, &ast.set).edges(out, &id, ""); @@ -343,7 +343,7 @@ impl ToDot for AstToDot { } } impl ToDot for AstToDot { - fn to_dot(&mut self, out: &mut Scope, ast: &ast::QuerySet) -> Targets { + fn to_dot(&mut self, out: &mut Scope<'_, '_>, ast: &ast::QuerySet) -> Targets { use ast::QuerySet; match &ast { QuerySet::BagOp(_) => todo!(), @@ -356,7 +356,7 @@ impl ToDot for AstToDot { } impl ToDot for AstToDot { - fn to_dot(&mut self, out: &mut Scope, ast: &ast::Select) -> Targets { + fn to_dot(&mut self, out: &mut Scope<'_, '_>, ast: &ast::Select) -> Targets { let id = out.node_auto_labelled("Select").id(); out.with_cluster("PROJECT", |mut cl| self.to_dot(&mut cl, &ast.project)) @@ -377,19 +377,19 @@ impl ToDot for AstToDot { } impl ToDot for AstToDot { - fn to_dot(&mut self, out: &mut Scope, ast: &ast::WhereClause) -> Targets { + fn to_dot(&mut self, out: &mut Scope<'_, '_>, ast: &ast::WhereClause) -> Targets { self.to_dot(out, &ast.expr) } } impl ToDot for AstToDot { - fn to_dot(&mut self, out: &mut Scope, ast: &ast::HavingClause) -> Targets { + fn to_dot(&mut self, out: &mut Scope<'_, '_>, ast: &ast::HavingClause) -> Targets { self.to_dot(out, &ast.expr) } } impl ToDot for AstToDot { - fn to_dot(&mut self, out: &mut Scope, ast: &ast::LimitOffsetClause) -> Targets { + fn to_dot(&mut self, out: &mut Scope<'_, '_>, ast: &ast::LimitOffsetClause) -> Targets { let mut list = self.to_dot(out, &ast.limit); list.extend(self.to_dot(out, &ast.offset)); list @@ -397,7 +397,7 @@ impl ToDot for AstToDot { } impl ToDot for AstToDot { - fn to_dot(&mut self, out: &mut Scope, ast: &ast::Projection) -> Targets { + fn to_dot(&mut self, out: &mut Scope<'_, '_>, ast: &ast::Projection) -> Targets { let lbl = match &ast.setq { Some(ast::SetQuantifier::Distinct) => "Projection | Distinct", _ => "Projection | All", @@ -429,7 +429,7 @@ impl ToDot for AstToDot { } impl ToDot for AstToDot { - fn to_dot(&mut self, out: &mut Scope, ast: &ast::ProjectItem) -> Targets { + fn to_dot(&mut self, out: &mut Scope<'_, '_>, ast: &ast::ProjectItem) -> Targets { match ast { ast::ProjectItem::ProjectAll(all) => { let id = out.node_auto_labelled("ProjectAll").id(); @@ -455,7 +455,7 @@ fn symbol_primitive_to_label(sym: &ast::SymbolPrimitive) -> String { } impl ToDot for AstToDot { - fn to_dot(&mut self, out: &mut Scope, ast: &ast::SymbolPrimitive) -> Targets { + fn to_dot(&mut self, out: &mut Scope<'_, '_>, ast: &ast::SymbolPrimitive) -> Targets { let lbl = symbol_primitive_to_label(ast); let id = out.node_auto_labelled(&lbl).id(); vec![id] @@ -463,7 +463,7 @@ impl ToDot for AstToDot { } impl ToDot for AstToDot { - fn to_dot(&mut self, out: &mut Scope, ast: &ast::VarRef) -> Targets { + fn to_dot(&mut self, out: &mut Scope<'_, '_>, ast: &ast::VarRef) -> Targets { let lbl = symbol_primitive_to_label(&ast.name); let lbl = match &ast.qualifier { ast::ScopeQualifier::Unqualified => lbl, @@ -476,25 +476,25 @@ impl ToDot for AstToDot { } impl ToDot for AstToDot { - fn to_dot(&mut self, _out: &mut Scope, _ast: &ast::OrderByExpr) -> Targets { + fn to_dot(&mut self, _out: &mut Scope<'_, '_>, _ast: &ast::OrderByExpr) -> Targets { todo!("OrderByExpr"); } } impl ToDot for AstToDot { - fn to_dot(&mut self, _out: &mut Scope, _ast: &ast::GroupByExpr) -> Targets { + fn to_dot(&mut self, _out: &mut Scope<'_, '_>, _ast: &ast::GroupByExpr) -> Targets { todo!("GroupByExpr"); } } impl ToDot for AstToDot { - fn to_dot(&mut self, out: &mut Scope, ast: &ast::FromClause) -> Targets { + fn to_dot(&mut self, out: &mut Scope<'_, '_>, ast: &ast::FromClause) -> Targets { self.to_dot(out, &ast.source) } } impl ToDot for AstToDot { - fn to_dot(&mut self, out: &mut Scope, ast: &ast::FromSource) -> Targets { + fn to_dot(&mut self, out: &mut Scope<'_, '_>, ast: &ast::FromSource) -> Targets { match &ast { ast::FromSource::FromLet(fl) => self.to_dot(out, fl), ast::FromSource::Join(j) => self.to_dot(out, j), @@ -503,7 +503,7 @@ impl ToDot for AstToDot { } impl ToDot for AstToDot { - fn to_dot(&mut self, out: &mut Scope, ast: &ast::FromLet) -> Targets { + fn to_dot(&mut self, out: &mut Scope<'_, '_>, ast: &ast::FromLet) -> Targets { let lbl = match &ast.kind { ast::FromLetKind::Scan => "Scan", ast::FromLetKind::Unpivot => "Unpivot", @@ -520,7 +520,7 @@ impl ToDot for AstToDot { } impl ToDot for AstToDot { - fn to_dot(&mut self, out: &mut Scope, ast: &ast::Join) -> Targets { + fn to_dot(&mut self, out: &mut Scope<'_, '_>, ast: &ast::Join) -> Targets { let lbl = match &ast.kind { ast::JoinKind::Inner => "Inner Join", ast::JoinKind::Left => "Left Join", @@ -540,7 +540,7 @@ impl ToDot for AstToDot { } impl ToDot for AstToDot { - fn to_dot(&mut self, out: &mut Scope, ast: &ast::JoinSpec) -> Targets { + fn to_dot(&mut self, out: &mut Scope<'_, '_>, ast: &ast::JoinSpec) -> Targets { match &ast { ast::JoinSpec::On(fl) => { let id = out.node_auto_labelled("On").id(); @@ -558,7 +558,7 @@ impl ToDot for AstToDot { } impl ToDot for AstToDot { - fn to_dot(&mut self, out: &mut Scope, ast: &ast::Call) -> Targets { + fn to_dot(&mut self, out: &mut Scope<'_, '_>, ast: &ast::Call) -> Targets { let id = out.node_auto_labelled("Call").id(); self.to_dot(out, &ast.func_name).edges(out, &id, "name"); @@ -569,7 +569,7 @@ impl ToDot for AstToDot { } impl ToDot for AstToDot { - fn to_dot(&mut self, out: &mut Scope, ast: &ast::CallArg) -> Targets { + fn to_dot(&mut self, out: &mut Scope<'_, '_>, ast: &ast::CallArg) -> Targets { use ast::CallArg; match ast { ast::CallArg::Star() => vec![out.node_auto_labelled("*").id()], @@ -606,7 +606,7 @@ impl ToDot for AstToDot { } impl ToDot for AstToDot { - fn to_dot(&mut self, out: &mut Scope, ast: &ast::CallAgg) -> Targets { + fn to_dot(&mut self, out: &mut Scope<'_, '_>, ast: &ast::CallAgg) -> Targets { // Set quantifier is defined in `CallAgg.args` let id = out.node_auto_labelled("CallAgg").id(); @@ -618,7 +618,7 @@ impl ToDot for AstToDot { } impl ToDot for AstToDot { - fn to_dot(&mut self, out: &mut Scope, ast: &ast::Path) -> Targets { + fn to_dot(&mut self, out: &mut Scope<'_, '_>, ast: &ast::Path) -> Targets { let id = out.node_auto_labelled("Path").id(); self.to_dot(out, &ast.root).edges(out, &id, "root"); @@ -629,7 +629,7 @@ impl ToDot for AstToDot { } impl ToDot for AstToDot { - fn to_dot(&mut self, out: &mut Scope, ast: &ast::PathStep) -> Targets { + fn to_dot(&mut self, out: &mut Scope<'_, '_>, ast: &ast::PathStep) -> Targets { match &ast { ast::PathStep::PathExpr(e) => self.to_dot(out, e), ast::PathStep::PathWildCard => vec![out.node_auto_labelled("*").id()], @@ -639,7 +639,7 @@ impl ToDot for AstToDot { } impl ToDot for AstToDot { - fn to_dot(&mut self, out: &mut Scope, ast: &ast::PathExpr) -> Targets { + fn to_dot(&mut self, out: &mut Scope<'_, '_>, ast: &ast::PathExpr) -> Targets { let id = out.node_auto_labelled("PathExpr").id(); self.to_dot(out, &ast.index).edges(out, &id, "index"); @@ -649,7 +649,7 @@ impl ToDot for AstToDot { } impl ToDot for AstToDot { - fn to_dot(&mut self, _out: &mut Scope, _ast: &ast::Let) -> Targets { + fn to_dot(&mut self, _out: &mut Scope<'_, '_>, _ast: &ast::Let) -> Targets { todo!("Let"); } } diff --git a/extension/partiql-extension-visualize/src/plan_to_dot.rs b/extension/partiql-extension-visualize/src/plan_to_dot.rs index 5bc6beac..980e3d2c 100644 --- a/extension/partiql-extension-visualize/src/plan_to_dot.rs +++ b/extension/partiql-extension-visualize/src/plan_to_dot.rs @@ -12,7 +12,7 @@ use crate::common::{ToDotGraph, FG_COLOR}; pub struct PlanToDot {} impl PlanToDot { - pub(crate) fn to_dot(&self, scope: &mut Scope, plan: &LogicalPlan) { + pub(crate) fn to_dot(&self, scope: &mut Scope<'_, '_>, plan: &LogicalPlan) { let mut graph_nodes = HashMap::new(); for (opid, op) in plan.operators_by_id() { graph_nodes.insert(opid, self.op_to_dot(scope, op)); @@ -29,7 +29,7 @@ impl PlanToDot { } } - fn op_to_dot(&self, scope: &mut Scope, op: &BindingsOp) -> NodeId { + fn op_to_dot(&self, scope: &mut Scope<'_, '_>, op: &BindingsOp) -> NodeId { let mut node = scope.node_auto(); let label = match op { BindingsOp::Scan(s) => { diff --git a/partiql-catalog/src/context.rs b/partiql-catalog/src/context.rs index 2094f51d..6e8ca7de 100644 --- a/partiql-catalog/src/context.rs +++ b/partiql-catalog/src/context.rs @@ -3,11 +3,11 @@ use std::any::Any; use std::fmt::Debug; pub trait Bindings: Debug { - fn get(&self, name: &BindingsName) -> Option<&T>; + fn get(&self, name: &BindingsName<'_>) -> Option<&T>; } impl Bindings for Tuple { - fn get(&self, name: &BindingsName) -> Option<&Value> { + fn get(&self, name: &BindingsName<'_>) -> Option<&Value> { self.get(name) } } diff --git a/partiql-catalog/src/lib.rs b/partiql-catalog/src/lib.rs index f73d1aa7..b0b38827 100644 --- a/partiql-catalog/src/lib.rs +++ b/partiql-catalog/src/lib.rs @@ -57,7 +57,7 @@ pub type BaseTableExprResult<'a> = pub trait BaseTableExpr: Debug { fn evaluate<'c>( &self, - args: &[Cow], + args: &[Cow<'_, Value>], ctx: &'c dyn SessionContext<'c>, ) -> BaseTableExprResult<'c>; } @@ -114,9 +114,9 @@ pub enum CatalogErrorKind { pub trait Catalog: Debug { fn add_table_function(&mut self, info: TableFunction) -> Result; - fn add_type_entry(&mut self, entry: TypeEnvEntry) -> Result; + fn add_type_entry(&mut self, entry: TypeEnvEntry<'_>) -> Result; - fn get_function(&self, name: &str) -> Option; + fn get_function(&self, name: &str) -> Option>; fn resolve_type(&self, name: &str) -> Option; } @@ -224,7 +224,7 @@ impl Catalog for PartiqlCatalog { } } - fn add_type_entry(&mut self, entry: TypeEnvEntry) -> Result { + fn add_type_entry(&mut self, entry: TypeEnvEntry<'_>) -> Result { let id = self .types .add(entry.name.as_ref(), entry.aliases.as_slice(), entry.ty); @@ -238,7 +238,7 @@ impl Catalog for PartiqlCatalog { } } - fn get_function(&self, name: &str) -> Option { + fn get_function(&self, name: &str) -> Option> { self.functions .find_by_name(name) .map(|(eid, entry)| FunctionEntry { diff --git a/partiql-conformance-tests/tests/mod.rs b/partiql-conformance-tests/tests/mod.rs index 46510126..15c276af 100644 --- a/partiql-conformance-tests/tests/mod.rs +++ b/partiql-conformance-tests/tests/mod.rs @@ -40,7 +40,7 @@ pub(crate) fn parse(statement: &str) -> ParserResult { #[inline] pub(crate) fn lower( catalog: &dyn Catalog, - parsed: &Parsed, + parsed: &Parsed<'_>, ) -> Result, AstTransformationError> { let planner = partiql_logical_planner::LogicalPlanner::new(catalog); planner.lower(parsed) diff --git a/partiql-eval/src/env.rs b/partiql-eval/src/env.rs index 7d1f2cd6..99722773 100644 --- a/partiql-eval/src/env.rs +++ b/partiql-eval/src/env.rs @@ -44,7 +44,7 @@ pub mod basic { T: Debug, { #[inline] - fn get(&self, name: &BindingsName) -> Option<&T> { + fn get(&self, name: &BindingsName<'_>) -> Option<&T> { let idx = match name { BindingsName::CaseSensitive(s) => self.sensitive.get(s.as_ref()), BindingsName::CaseInsensitive(s) => { diff --git a/partiql-eval/src/error.rs b/partiql-eval/src/error.rs index e310931f..50f22112 100644 --- a/partiql-eval/src/error.rs +++ b/partiql-eval/src/error.rs @@ -65,7 +65,7 @@ impl Evaluable for ErrorNode { panic!("ErrorNode will not be evaluated") } - fn update_input(&mut self, _input: Value, _branch_num: u8, _ctx: &dyn EvalContext) { + fn update_input(&mut self, _input: Value, _branch_num: u8, _ctx: &dyn EvalContext<'_>) { panic!("ErrorNode will not be evaluated") } } diff --git a/partiql-eval/src/eval/eval_expr_wrapper.rs b/partiql-eval/src/eval/eval_expr_wrapper.rs index ada92854..8d53be21 100644 --- a/partiql-eval/src/eval/eval_expr_wrapper.rs +++ b/partiql-eval/src/eval/eval_expr_wrapper.rs @@ -247,7 +247,7 @@ impl, ArgC: ArgChecker } /// Evaluate the input argument expressions in [`self.args`] in the environment, type check them, - /// and convert them into an array of `N` `Cow`s. + /// and convert them into an array of `N` `Cow<'_, Value>`s. /// /// If type-checking fails, the appropriate failure case of [`ArgCheckControlFlow`] is returned, /// else [`ArgCheckControlFlow::Continue`] is returned containing the `N` values. @@ -255,7 +255,7 @@ impl, ArgC: ArgChecker &'a self, bindings: &'a Tuple, ctx: &'c dyn EvalContext<'c>, - ) -> ControlFlow; N]> + ) -> ControlFlow; N]> where 'c: 'a, { diff --git a/partiql-eval/src/eval/evaluable.rs b/partiql-eval/src/eval/evaluable.rs index 95c5db2b..87bca0e1 100644 --- a/partiql-eval/src/eval/evaluable.rs +++ b/partiql-eval/src/eval/evaluable.rs @@ -41,7 +41,7 @@ pub enum EvalType { /// `Evaluable` represents each evaluation operator in the evaluation plan as an evaluable entity. pub trait Evaluable: Debug { fn evaluate<'c>(&mut self, ctx: &'c dyn EvalContext<'c>) -> Value; - fn update_input(&mut self, input: Value, branch_num: u8, ctx: &dyn EvalContext); + fn update_input(&mut self, input: Value, branch_num: u8, ctx: &dyn EvalContext<'_>); fn get_vars(&self) -> Option<&[String]> { None } @@ -140,7 +140,7 @@ impl Evaluable for EvalScan { Value::Bag(Box::new(value)) } - fn update_input(&mut self, input: Value, _branch_num: u8, _ctx: &dyn EvalContext) { + fn update_input(&mut self, input: Value, _branch_num: u8, _ctx: &dyn EvalContext<'_>) { self.input = Some(input); } @@ -337,7 +337,7 @@ impl Evaluable for EvalJoin { Value::Bag(Box::new(output_bag)) } - fn update_input(&mut self, input: Value, _branch_num: u8, _ctx: &dyn EvalContext) { + fn update_input(&mut self, input: Value, _branch_num: u8, _ctx: &dyn EvalContext<'_>) { self.input = Some(input); } @@ -744,7 +744,7 @@ impl Evaluable for EvalGroupBy { } } - fn update_input(&mut self, input: Value, _branch_num: u8, _ctx: &dyn EvalContext) { + fn update_input(&mut self, input: Value, _branch_num: u8, _ctx: &dyn EvalContext<'_>) { self.input = Some(input); } } @@ -789,7 +789,7 @@ impl Evaluable for EvalPivot { Value::from(tuple) } - fn update_input(&mut self, input: Value, _branch_num: u8, _ctx: &dyn EvalContext) { + fn update_input(&mut self, input: Value, _branch_num: u8, _ctx: &dyn EvalContext<'_>) { self.input = Some(input); } } @@ -847,7 +847,7 @@ impl Evaluable for EvalUnpivot { Value::from(unpivoted) } - fn update_input(&mut self, input: Value, _branch_num: u8, _ctx: &dyn EvalContext) { + fn update_input(&mut self, input: Value, _branch_num: u8, _ctx: &dyn EvalContext<'_>) { self.input = Some(input); } @@ -894,7 +894,7 @@ impl Evaluable for EvalFilter { Value::from(filtered.collect::()) } - fn update_input(&mut self, input: Value, _branch_num: u8, _ctx: &dyn EvalContext) { + fn update_input(&mut self, input: Value, _branch_num: u8, _ctx: &dyn EvalContext<'_>) { self.input = Some(input); } } @@ -939,7 +939,7 @@ impl Evaluable for EvalHaving { Value::from(filtered.collect::()) } - fn update_input(&mut self, input: Value, _branch_num: u8, _ctx: &dyn EvalContext) { + fn update_input(&mut self, input: Value, _branch_num: u8, _ctx: &dyn EvalContext<'_>) { self.input = Some(input); } } @@ -1013,7 +1013,7 @@ impl Evaluable for EvalOrderBy { Value::from(List::from(values)) } - fn update_input(&mut self, input: Value, _branch_num: u8, _ctx: &dyn EvalContext) { + fn update_input(&mut self, input: Value, _branch_num: u8, _ctx: &dyn EvalContext<'_>) { self.input = Some(input); } } @@ -1075,7 +1075,7 @@ impl Evaluable for EvalLimitOffset { } } - fn update_input(&mut self, input: Value, _branch_num: u8, _ctx: &dyn EvalContext) { + fn update_input(&mut self, input: Value, _branch_num: u8, _ctx: &dyn EvalContext<'_>) { self.input = Some(input); } } @@ -1112,7 +1112,7 @@ impl Evaluable for EvalSelectValue { } } - fn update_input(&mut self, input: Value, _branch_num: u8, _ctx: &dyn EvalContext) { + fn update_input(&mut self, input: Value, _branch_num: u8, _ctx: &dyn EvalContext<'_>) { self.input = Some(input); } } @@ -1173,7 +1173,7 @@ impl Evaluable for EvalSelect { } } - fn update_input(&mut self, input: Value, _branch_num: u8, _ctx: &dyn EvalContext) { + fn update_input(&mut self, input: Value, _branch_num: u8, _ctx: &dyn EvalContext<'_>) { self.input = Some(input); } } @@ -1210,7 +1210,7 @@ impl Evaluable for EvalSelectAll { } } - fn update_input(&mut self, input: Value, _branch_num: u8, _ctx: &dyn EvalContext) { + fn update_input(&mut self, input: Value, _branch_num: u8, _ctx: &dyn EvalContext<'_>) { self.input = Some(input); } } @@ -1237,7 +1237,7 @@ impl Evaluable for EvalExprQuery { self.expr.evaluate(&input_value, ctx).into_owned() } - fn update_input(&mut self, input: Value, _branch_num: u8, _ctx: &dyn EvalContext) { + fn update_input(&mut self, input: Value, _branch_num: u8, _ctx: &dyn EvalContext<'_>) { self.input = Some(input); } } @@ -1266,7 +1266,7 @@ impl Evaluable for EvalDistinct { } } - fn update_input(&mut self, input: Value, _branch_num: u8, _ctx: &dyn EvalContext) { + fn update_input(&mut self, input: Value, _branch_num: u8, _ctx: &dyn EvalContext<'_>) { self.input = Some(input); } } @@ -1281,7 +1281,7 @@ impl Evaluable for EvalSink { self.input.take().unwrap_or_else(|| Missing) } - fn update_input(&mut self, input: Value, _branch_num: u8, _ctx: &dyn EvalContext) { + fn update_input(&mut self, input: Value, _branch_num: u8, _ctx: &dyn EvalContext<'_>) { self.input = Some(input); } } @@ -1318,7 +1318,7 @@ impl EvalExpr for EvalSubQueryExpr { { let bindings = MapBindings::from(bindings); let value = { - let nested_ctx: NestedContext = NestedContext::new(bindings, ctx); + let nested_ctx: NestedContext<'_, '_> = NestedContext::new(bindings, ctx); let mut plan = self.plan.borrow_mut(); if let Ok(evaluated) = plan.execute_mut(&nested_ctx) { @@ -1377,7 +1377,7 @@ impl Evaluable for EvalOuterUnion { Value::from(Bag::from(vals)) } - fn update_input(&mut self, input: Value, branch_num: u8, ctx: &dyn EvalContext) { + fn update_input(&mut self, input: Value, branch_num: u8, ctx: &dyn EvalContext<'_>) { match branch_num { 0 => self.l_input = Some(input), 1 => self.r_input = Some(input), @@ -1433,7 +1433,7 @@ impl Evaluable for EvalOuterIntersect { Value::from(bag) } - fn update_input(&mut self, input: Value, branch_num: u8, ctx: &dyn EvalContext) { + fn update_input(&mut self, input: Value, branch_num: u8, ctx: &dyn EvalContext<'_>) { match branch_num { 0 => self.l_input = Some(input), 1 => self.r_input = Some(input), @@ -1482,7 +1482,7 @@ impl Evaluable for EvalOuterExcept { Value::from(Bag::from(vals)) } - fn update_input(&mut self, input: Value, branch_num: u8, ctx: &dyn EvalContext) { + fn update_input(&mut self, input: Value, branch_num: u8, ctx: &dyn EvalContext<'_>) { match branch_num { 0 => self.l_input = Some(input), 1 => self.r_input = Some(input), diff --git a/partiql-eval/src/eval/expr/coll.rs b/partiql-eval/src/eval/expr/coll.rs index 7f0ac4eb..8b9845da 100644 --- a/partiql-eval/src/eval/expr/coll.rs +++ b/partiql-eval/src/eval/expr/coll.rs @@ -43,7 +43,7 @@ impl BindEvalExpr for EvalCollFn { f: F, ) -> Result, BindError> where - F: Fn(ValueIter) -> Value + 'static, + F: Fn(ValueIter<'_>) -> Value + 'static, { UnaryValueExpr::create_typed::<{ STRICT }, _>(types, args, move |value| { value.sequence_iter().map(&f).unwrap_or(Missing) diff --git a/partiql-eval/src/eval/expr/path.rs b/partiql-eval/src/eval/expr/path.rs index c0bf8801..8e499cb1 100644 --- a/partiql-eval/src/eval/expr/path.rs +++ b/partiql-eval/src/eval/expr/path.rs @@ -65,7 +65,7 @@ fn as_str(v: &Value) -> Option<&str> { } #[inline] -fn as_name(v: &Value) -> Option { +fn as_name(v: &Value) -> Option> { as_str(v).map(|key| BindingsName::CaseInsensitive(Cow::Borrowed(key))) } @@ -189,7 +189,7 @@ impl BindEvalExpr for EvalVarRef { } #[inline] -fn borrow_or_missing(value: Option<&Value>) -> Cow { +fn borrow_or_missing(value: Option<&Value>) -> Cow<'_, Value> { value.map_or_else(|| Cow::Owned(Missing), Cow::Borrowed) } diff --git a/partiql-logical-planner/src/lib.rs b/partiql-logical-planner/src/lib.rs index ec09534a..60a6256e 100644 --- a/partiql-logical-planner/src/lib.rs +++ b/partiql-logical-planner/src/lib.rs @@ -25,7 +25,7 @@ impl<'c> LogicalPlanner<'c> { #[inline] pub fn lower( &self, - parsed: &Parsed, + parsed: &Parsed<'_>, ) -> Result, AstTransformationError> { let q = &parsed.ast; let catalog = PartiqlCatalog::default(); @@ -56,13 +56,13 @@ mod tests { use partiql_value::{bag, tuple, DateTime, Value}; #[track_caller] - fn parse(text: &str) -> Parsed { + fn parse(text: &str) -> Parsed<'_> { Parser::default().parse(text).unwrap() } #[track_caller] fn lower( - parsed: &Parsed, + parsed: &Parsed<'_>, ) -> Result, AstTransformationError> { let catalog = PartiqlCatalog::default(); let planner = LogicalPlanner::new(&catalog); diff --git a/partiql-logical-planner/src/typer.rs b/partiql-logical-planner/src/typer.rs index a142b64e..9a561bc8 100644 --- a/partiql-logical-planner/src/typer.rs +++ b/partiql-logical-planner/src/typer.rs @@ -257,7 +257,7 @@ impl<'c> PlanTyper<'c> { } fn type_vexpr(&mut self, v: &ValueExpr, lookup_order: LookupOrder) { - fn binding_to_sym(binding: &BindingsName) -> SymbolPrimitive { + fn binding_to_sym(binding: &BindingsName<'_>) -> SymbolPrimitive { match binding { BindingsName::CaseSensitive(s) => SymbolPrimitive { value: s.to_string(), @@ -893,7 +893,7 @@ mod tests { fn type_query( mode: TypingMode, query: &str, - type_env_entry: TypeEnvEntry, + type_env_entry: TypeEnvEntry<'_>, ) -> Result { let mut catalog = PartiqlCatalog::default(); let _oid = catalog.add_type_entry(type_env_entry); @@ -910,13 +910,13 @@ mod tests { } #[track_caller] - fn parse(text: &str) -> Parsed { + fn parse(text: &str) -> Parsed<'_> { Parser::default().parse(text).unwrap() } #[track_caller] fn lower( - parsed: &Parsed, + parsed: &Parsed<'_>, catalog: &dyn Catalog, ) -> Result, AstTransformationError> { let planner = LogicalPlanner::new(catalog); diff --git a/partiql-parser/src/error.rs b/partiql-parser/src/error.rs index ee075b41..239f29d4 100644 --- a/partiql-parser/src/error.rs +++ b/partiql-parser/src/error.rs @@ -144,7 +144,7 @@ mod tests { #[test] fn illegal_state() { - let e1: ParseError = ParseError::IllegalState("uh oh".to_string()); + let e1: ParseError<'_, BytePosition> = ParseError::IllegalState("uh oh".to_string()); let e2 = e1.map_loc(|x| x); assert_eq!(e2.to_string(), "Illegal State: uh oh") diff --git a/partiql-parser/src/lexer.rs b/partiql-parser/src/lexer.rs index 1320c841..e2a572c3 100644 --- a/partiql-parser/src/lexer.rs +++ b/partiql-parser/src/lexer.rs @@ -983,7 +983,7 @@ mod tests { let mut offset_tracker = LineOffsetTracker::default(); let nonnested_lex = CommentLexer::new(comments, &mut offset_tracker); - let toks: Result, Spanned> = nonnested_lex.collect(); + let toks: Result, Spanned, ByteOffset>> = nonnested_lex.collect(); assert!(toks.is_err()); let error = toks.unwrap_err(); assert!(matches!( @@ -1299,7 +1299,7 @@ mod tests { let query = r#" `/*12345678`"#; let mut offset_tracker = LineOffsetTracker::default(); let ion_lexer = EmbeddedIonLexer::new(query, &mut offset_tracker); - let toks: Result, Spanned> = ion_lexer.collect(); + let toks: Result, Spanned, ByteOffset>> = ion_lexer.collect(); assert!(toks.is_err()); let error = toks.unwrap_err(); assert!(matches!( diff --git a/partiql-parser/src/parse/mod.rs b/partiql-parser/src/parse/mod.rs index cb740834..b5f65544 100644 --- a/partiql-parser/src/parse/mod.rs +++ b/partiql-parser/src/parse/mod.rs @@ -27,6 +27,7 @@ use partiql_source_map::metadata::LocationMap; #[allow(clippy::unused_unit)] #[allow(unused_variables)] #[allow(dead_code)] +#[allow(rust_2018_idioms)] mod grammar { include!(concat!(env!("OUT_DIR"), "/partiql.rs")); } @@ -53,7 +54,7 @@ pub(crate) struct ErrorData<'input> { pub(crate) type AstResult<'input> = Result>; /// Parse PartiQL query text into an AST. -pub(crate) fn parse_partiql(s: &str) -> AstResult { +pub(crate) fn parse_partiql(s: &str) -> AstResult<'_> { parse_partiql_with_state(s, ParserState::default()) } @@ -65,7 +66,7 @@ fn parse_partiql_with_state<'input, Id: IdGenerator>( let lexer = PreprocessingPartiqlLexer::new(s, &mut offsets, &BUILT_INS); let lexer = CommentSkippingLexer::new(lexer); - let result: LalrpopResult = grammar::TopLevelQueryParser::new().parse(s, &mut state, lexer); + let result: LalrpopResult<'_> = grammar::TopLevelQueryParser::new().parse(s, &mut state, lexer); let ParserState { locations, errors, .. @@ -143,7 +144,7 @@ impl<'input> From> for ParseError<'input, BytePosition> { #[cfg(test)] mod tests { use super::*; - fn parse_partiql(s: &str) -> AstResult { + fn parse_partiql(s: &str) -> AstResult<'_> { super::parse_partiql(s) } @@ -559,7 +560,7 @@ mod tests { } } - fn parse_partiql_null_id(s: &str) -> AstResult { + fn parse_partiql_null_id(s: &str) -> AstResult<'_> { super::parse_partiql_with_state(s, ParserState::new_null_id()) } diff --git a/partiql-parser/src/parse/parse_util.rs b/partiql-parser/src/parse/parse_util.rs index 976a1630..04525d08 100644 --- a/partiql-parser/src/parse/parse_util.rs +++ b/partiql-parser/src/parse/parse_util.rs @@ -104,7 +104,7 @@ pub(crate) fn strip_query(q: ast::AstNode) -> ast::AstNode( qs: ast::AstNode, - state: &mut ParserState, + state: &mut ParserState<'_, Id>, lo: ByteOffset, hi: ByteOffset, ) -> ast::AstNode diff --git a/partiql-parser/src/preprocessor.rs b/partiql-parser/src/preprocessor.rs index 54ddfaae..78ac009e 100644 --- a/partiql-parser/src/preprocessor.rs +++ b/partiql-parser/src/preprocessor.rs @@ -349,7 +349,7 @@ where self.parser.expect(&Token::OpenParen)?; let fn_expr_args = &fn_expr.patterns; - let mut patterns: Vec<(&[FnExprArgMatch], Substitutions)> = fn_expr_args + let mut patterns: Vec<(&[FnExprArgMatch<'_>], Substitutions<'_>)> = fn_expr_args .iter() .map(|args| (args.as_slice(), vec![])) .collect(); @@ -711,12 +711,12 @@ mod tests { .map(|result| result.map(|(_, t, _)| t)) .collect::, _>>() } - fn lex(query: &str) -> Result, ParseError> { + fn lex(query: &str) -> Result>, ParseError<'_>> { let mut offset_tracker = LineOffsetTracker::default(); let lexer = PartiqlLexer::new(query, &mut offset_tracker); to_tokens(lexer) } - fn preprocess(query: &str) -> Result, ParseError> { + fn preprocess(query: &str) -> Result>, ParseError<'_>> { let mut offset_tracker = LineOffsetTracker::default(); let lexer = PreprocessingPartiqlLexer::new(query, &mut offset_tracker, &BUILT_INS); to_tokens(lexer) diff --git a/partiql-parser/src/token_parser.rs b/partiql-parser/src/token_parser.rs index 2f8b3cd6..ca65aa3f 100644 --- a/partiql-parser/src/token_parser.rs +++ b/partiql-parser/src/token_parser.rs @@ -78,7 +78,10 @@ impl<'input, 'tracker> TokenParser<'input, 'tracker> { /// /// If there are no tokens to buffer or the match fails, returns [`Err`]. #[inline] - pub fn expect(&mut self, target: &Token) -> Result<(), Spanned, ByteOffset>> { + pub fn expect( + &mut self, + target: &Token<'_>, + ) -> Result<(), Spanned, ByteOffset>> { match self.peek_n(0) { Some(((_, tok, _), _)) if target == tok => { self.consumed_c += 1; diff --git a/partiql-value/src/bag.rs b/partiql-value/src/bag.rs index 2cdebf81..5b9e87c2 100644 --- a/partiql-value/src/bag.rs +++ b/partiql-value/src/bag.rs @@ -34,7 +34,7 @@ impl Bag { } #[inline] - pub fn iter(&self) -> BagIter { + pub fn iter(&self) -> BagIter<'_> { BagIter(self.0.iter()) } diff --git a/partiql-value/src/lib.rs b/partiql-value/src/lib.rs index ef6f1c10..cdbb2812 100644 --- a/partiql-value/src/lib.rs +++ b/partiql-value/src/lib.rs @@ -636,7 +636,7 @@ impl Value { } #[inline] - pub fn as_tuple_ref(&self) -> Cow { + pub fn as_tuple_ref(&self) -> Cow<'_, Tuple> { if let Value::Tuple(t) = self { Cow::Borrowed(t) } else { @@ -645,7 +645,7 @@ impl Value { } #[inline] - pub fn as_bindings(&self) -> BindingIter { + pub fn as_bindings(&self) -> BindingIter<'_> { match self { Value::Tuple(t) => BindingIter::Tuple(t.pairs()), Value::Missing => BindingIter::Empty, @@ -672,7 +672,7 @@ impl Value { } #[inline] - pub fn as_bag_ref(&self) -> Cow { + pub fn as_bag_ref(&self) -> Cow<'_, Bag> { if let Value::Bag(b) = self { Cow::Borrowed(b) } else { @@ -690,7 +690,7 @@ impl Value { } #[inline] - pub fn as_list_ref(&self) -> Cow { + pub fn as_list_ref(&self) -> Cow<'_, List> { if let Value::List(l) = self { Cow::Borrowed(l) } else { @@ -699,7 +699,7 @@ impl Value { } #[inline] - pub fn iter(&self) -> ValueIter { + pub fn iter(&self) -> ValueIter<'_> { match self { Value::Null | Value::Missing => ValueIter::Single(None), Value::List(list) => ValueIter::List(list.iter()), @@ -709,7 +709,7 @@ impl Value { } #[inline] - pub fn sequence_iter(&self) -> Option { + pub fn sequence_iter(&self) -> Option> { if self.is_sequence() { Some(self.iter()) } else { @@ -1213,15 +1213,15 @@ mod tests { "Rc> size: {}", mem::size_of::>>() ); - println!("Cow<&Tuple> size: {}", mem::size_of::>()); + println!("Cow<&Tuple> size: {}", mem::size_of::>()); println!("Value size: {}", mem::size_of::()); println!("Option size: {}", mem::size_of::>()); println!( "Option> size: {}", mem::size_of::>>() ); - println!("Cow size: {}", mem::size_of::>()); - println!("Cow<&Value> size: {}", mem::size_of::>()); + println!("Cow<'_, Value> size: {}", mem::size_of::>()); + println!("Cow<&Value> size: {}", mem::size_of::>()); assert_eq!(mem::size_of::(), 16); assert_eq!(mem::size_of::>>(), 16); diff --git a/partiql-value/src/list.rs b/partiql-value/src/list.rs index 4a7b401e..12470a07 100644 --- a/partiql-value/src/list.rs +++ b/partiql-value/src/list.rs @@ -46,7 +46,7 @@ impl List { } #[inline] - pub fn iter(&self) -> ListIter { + pub fn iter(&self) -> ListIter<'_> { ListIter(self.0.iter()) } diff --git a/partiql-value/src/tuple.rs b/partiql-value/src/tuple.rs index 1e57bf0e..1dfda7bb 100644 --- a/partiql-value/src/tuple.rs +++ b/partiql-value/src/tuple.rs @@ -60,18 +60,18 @@ impl Tuple { } #[inline] - pub fn get(&self, attr: &BindingsName) -> Option<&Value> { + pub fn get(&self, attr: &BindingsName<'_>) -> Option<&Value> { self.find_value(attr).map(|i| &self.vals[i]) } #[inline] - pub fn take_val(self, attr: &BindingsName) -> Option { + pub fn take_val(self, attr: &BindingsName<'_>) -> Option { self.find_value(attr) .and_then(|i| self.vals.into_iter().nth(i)) } #[inline(always)] - fn find_value(&self, attr: &BindingsName) -> Option { + fn find_value(&self, attr: &BindingsName<'_>) -> Option { match attr { BindingsName::CaseSensitive(s) => { self.attrs.iter().position(|a| a.as_str() == s.as_ref()) @@ -84,7 +84,7 @@ impl Tuple { } #[inline] - pub fn remove(&mut self, attr: &BindingsName) -> Option { + pub fn remove(&mut self, attr: &BindingsName<'_>) -> Option { match self.find_value(attr) { Some(i) => { self.attrs.remove(i); @@ -95,7 +95,7 @@ impl Tuple { } #[inline] - pub fn pairs(&self) -> PairsIter { + pub fn pairs(&self) -> PairsIter<'_> { PairsIter(zip(self.attrs.iter(), self.vals.iter())) } diff --git a/partiql/src/lib.rs b/partiql/src/lib.rs index ccb2e889..984153c0 100644 --- a/partiql/src/lib.rs +++ b/partiql/src/lib.rs @@ -53,7 +53,7 @@ mod tests { #[track_caller] #[inline] - fn parse(statement: &str) -> ParserResult { + fn parse(statement: &str) -> ParserResult<'_> { partiql_parser::Parser::default().parse(statement) } @@ -61,7 +61,7 @@ mod tests { #[inline] fn lower( catalog: &dyn Catalog, - parsed: &Parsed, + parsed: &Parsed<'_>, ) -> Result, AstTransformationError> { let planner = partiql_logical_planner::LogicalPlanner::new(catalog); planner.lower(parsed) diff --git a/partiql/tests/extension_error.rs b/partiql/tests/extension_error.rs index 6f469fe6..764707c1 100644 --- a/partiql/tests/extension_error.rs +++ b/partiql/tests/extension_error.rs @@ -87,7 +87,7 @@ pub(crate) struct EvalTestCtxTable {} impl BaseTableExpr for EvalTestCtxTable { fn evaluate<'c>( &self, - args: &[Cow], + args: &[Cow<'_, Value>], _ctx: &'c dyn SessionContext<'c>, ) -> BaseTableExprResult<'c> { if let Some(arg1) = args.first() { @@ -124,7 +124,7 @@ pub(crate) fn parse(statement: &str) -> ParserResult { #[inline] pub(crate) fn lower( catalog: &dyn Catalog, - parsed: &Parsed, + parsed: &Parsed<'_>, ) -> partiql_logical::LogicalPlan { let planner = partiql_logical_planner::LogicalPlanner::new(catalog); planner.lower(parsed).expect("lower") diff --git a/partiql/tests/user_context.rs b/partiql/tests/user_context.rs index 59564c67..5ecead28 100644 --- a/partiql/tests/user_context.rs +++ b/partiql/tests/user_context.rs @@ -85,7 +85,7 @@ pub(crate) struct EvalTestCtxTable {} impl BaseTableExpr for EvalTestCtxTable { fn evaluate<'c>( &self, - args: &[Cow], + args: &[Cow<'_, Value>], ctx: &'c dyn SessionContext<'c>, ) -> BaseTableExprResult<'c> { if let Some(arg1) = args.first() { @@ -150,7 +150,7 @@ pub(crate) fn parse(statement: &str) -> ParserResult { #[inline] pub(crate) fn lower( catalog: &dyn Catalog, - parsed: &Parsed, + parsed: &Parsed<'_>, ) -> partiql_logical::LogicalPlan { let planner = partiql_logical_planner::LogicalPlanner::new(catalog); planner.lower(parsed).expect("lower")