Skip to content

Commit

Permalink
Fix up lifetimes that can be elided
Browse files Browse the repository at this point in the history
You can't propose a 26k line diff when CI fails.
  • Loading branch information
davisp committed Dec 8, 2024
1 parent 982a29b commit d1c90b2
Show file tree
Hide file tree
Showing 64 changed files with 65 additions and 65 deletions.
2 changes: 1 addition & 1 deletion src/parser/alter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use alloc::vec;

use crate::parser::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
pub fn parse_alter(&mut self) -> Result<Statement, ParserError> {
let object_type = self.expect_one_of_keywords(&[
Keyword::VIEW,
Expand Down
2 changes: 1 addition & 1 deletion src/parser/analyze.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::parser::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
pub fn parse_analyze(&mut self) -> Result<Statement, ParserError> {
self.expect_keyword(Keyword::TABLE)?;
let table_name = self.parse_object_name(false)?;
Expand Down
2 changes: 1 addition & 1 deletion src/parser/assert.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::parser::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
pub fn parse_assert(&mut self) -> Result<Statement, ParserError> {
let condition = self.parse_expr()?;
let message = if self.parse_keyword(Keyword::AS) {
Expand Down
2 changes: 1 addition & 1 deletion src/parser/assignment.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::parser::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
/// Parse a `var = expr` assignment, used in an UPDATE statement
pub fn parse_assignment(&mut self) -> Result<Assignment, ParserError> {
let target = self.parse_assignment_target()?;
Expand Down
2 changes: 1 addition & 1 deletion src/parser/attach.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::parser::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
pub fn parse_attach_database(&mut self) -> Result<Statement, ParserError> {
let database = self.parse_keyword(Keyword::DATABASE);
let database_file_name = self.parse_expr()?;
Expand Down
2 changes: 1 addition & 1 deletion src/parser/cache.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::parser::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
/// Parse a CACHE TABLE statement
pub fn parse_cache_table(&mut self) -> Result<Statement, ParserError> {
let (mut table_flag, mut options, mut has_as, mut query) = (None, vec![], false, None);
Expand Down
2 changes: 1 addition & 1 deletion src/parser/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::parser::*;

use crate::parser_err;

impl<'a> Parser<'a> {
impl Parser<'_> {
/// Parse a `CALL procedure_name(arg1, arg2, ...)`
/// or `CALL procedure_name` statement
pub fn parse_call(&mut self) -> Result<Statement, ParserError> {
Expand Down
2 changes: 1 addition & 1 deletion src/parser/close.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::parser::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
pub fn parse_close(&mut self) -> Result<Statement, ParserError> {
let cursor = if self.parse_keyword(Keyword::ALL) {
CloseCursor::All
Expand Down
2 changes: 1 addition & 1 deletion src/parser/columns.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
pub fn parse_columns(&mut self) -> Result<(Vec<ColumnDef>, Vec<TableConstraint>), ParserError> {
let mut columns = vec![];
let mut constraints = vec![];
Expand Down
2 changes: 1 addition & 1 deletion src/parser/comment.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::parser::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
pub fn parse_comment(&mut self) -> Result<Statement, ParserError> {
let if_exists = self.parse_keywords(&[Keyword::IF, Keyword::EXISTS]);

Expand Down
2 changes: 1 addition & 1 deletion src/parser/commit.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::parser::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
pub fn parse_commit(&mut self) -> Result<Statement, ParserError> {
Ok(Statement::Commit {
chain: self.parse_commit_rollback_chain()?,
Expand Down
2 changes: 1 addition & 1 deletion src/parser/copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use super::*;

use crate::parser_err;

impl<'a> Parser<'a> {
impl Parser<'_> {
/// Parse a copy statement
pub fn parse_copy(&mut self) -> Result<Statement, ParserError> {
let source;
Expand Down
2 changes: 1 addition & 1 deletion src/parser/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use super::*;

use crate::parser_err;

impl<'a> Parser<'a> {
impl Parser<'_> {
/// Parse a SQL CREATE statement
pub fn parse_create(&mut self) -> Result<Statement, ParserError> {
let or_replace = self.parse_keywords(&[Keyword::OR, Keyword::REPLACE]);
Expand Down
2 changes: 1 addition & 1 deletion src/parser/deallocate.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::parser::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
pub fn parse_deallocate(&mut self) -> Result<Statement, ParserError> {
let prepare = self.parse_keyword(Keyword::PREPARE);
let name = self.parse_identifier(false)?;
Expand Down
2 changes: 1 addition & 1 deletion src/parser/declare.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::parser::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
/// Parse a `DECLARE` statement.
///
/// ```sql
Expand Down
2 changes: 1 addition & 1 deletion src/parser/delete.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::parser::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
pub fn parse_delete(&mut self) -> Result<Statement, ParserError> {
let (tables, with_from_keyword) = if !self.parse_keyword(Keyword::FROM) {
// `FROM` keyword is optional in BigQuery SQL.
Expand Down
2 changes: 1 addition & 1 deletion src/parser/dialects/bigquery.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::parser::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
/// Parse `CREATE FUNCTION` for [BigQuery]
///
/// [BigQuery]: https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#create_function_statement
Expand Down
2 changes: 1 addition & 1 deletion src/parser/dialects/clickhouse.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::parser::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
/// Parse clickhouse [map]
///
/// Syntax
Expand Down
2 changes: 1 addition & 1 deletion src/parser/dialects/duckdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::parser::*;

// DuckDB related parsing

impl<'a> Parser<'a> {
impl Parser<'_> {
pub fn parse_attach_duckdb_database_options(
&mut self,
) -> Result<Vec<AttachDuckDBDatabaseOption>, ParserError> {
Expand Down
2 changes: 1 addition & 1 deletion src/parser/dialects/hive.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::parser::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
/// Parse `CREATE FUNCTION` for [Hive]
///
/// [Hive]: https://cwiki.apache.org/confluence/display/hive/languagemanual+ddl#LanguageManualDDL-Create/Drop/ReloadFunction
Expand Down
2 changes: 1 addition & 1 deletion src/parser/dialects/mssql.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::parser::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
/// Parse a [MsSql] `DECLARE` statement.
///
/// Syntax:
Expand Down
2 changes: 1 addition & 1 deletion src/parser/dialects/postgresql.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::parser::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
/// Parse `CREATE FUNCTION` for [Postgres]
///
/// [Postgres]: https://www.postgresql.org/docs/15/sql-createfunction.html
Expand Down
2 changes: 1 addition & 1 deletion src/parser/dialects/snowflake.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::keywords::ALL_KEYWORDS;
use crate::parser::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
/// Parse a [Snowflake] `DECLARE` statement.
///
/// Syntax:
Expand Down
2 changes: 1 addition & 1 deletion src/parser/dialects/sqlite.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::parser::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
/// SQLite-specific `CREATE VIRTUAL TABLE`
pub fn parse_create_virtual_table(&mut self) -> Result<Statement, ParserError> {
self.expect_keyword(Keyword::TABLE)?;
Expand Down
2 changes: 1 addition & 1 deletion src/parser/dialects/utils.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::parser::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
/// Parse the body of a `CREATE FUNCTION` specified as a string.
/// e.g. `CREATE FUNCTION ... AS $$ body $$`.
pub(crate) fn parse_create_function_body_string(&mut self) -> Result<Expr, ParserError> {
Expand Down
2 changes: 1 addition & 1 deletion src/parser/discard.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::parser::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
pub fn parse_discard(&mut self) -> Result<Statement, ParserError> {
let object_type = if self.parse_keyword(Keyword::ALL) {
DiscardObject::ALL
Expand Down
2 changes: 1 addition & 1 deletion src/parser/drop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use super::*;

use crate::parser_err;

impl<'a> Parser<'a> {
impl Parser<'_> {
/// Parse statements of the DropTrigger type such as:
///
/// ```sql
Expand Down
2 changes: 1 addition & 1 deletion src/parser/end.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::parser::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
pub fn parse_end(&mut self) -> Result<Statement, ParserError> {
Ok(Statement::Commit {
chain: self.parse_commit_rollback_chain()?,
Expand Down
2 changes: 1 addition & 1 deletion src/parser/execute.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::parser::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
pub fn parse_execute(&mut self) -> Result<Statement, ParserError> {
let name = self.parse_object_name(false)?;

Expand Down
2 changes: 1 addition & 1 deletion src/parser/explain.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
pub fn parse_explain(
&mut self,
describe_alias: DescribeAlias,
Expand Down
2 changes: 1 addition & 1 deletion src/parser/fetch.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::parser::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
// FETCH [ direction { FROM | IN } ] cursor INTO target;
pub fn parse_fetch_statement(&mut self) -> Result<Statement, ParserError> {
let direction = if self.parse_keyword(Keyword::NEXT) {
Expand Down
2 changes: 1 addition & 1 deletion src/parser/flush.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::parser::*;

use crate::parser_err;

impl<'a> Parser<'a> {
impl Parser<'_> {
pub fn parse_flush(&mut self) -> Result<Statement, ParserError> {
let mut channel = None;
let mut tables: Vec<ObjectName> = vec![];
Expand Down
2 changes: 1 addition & 1 deletion src/parser/grant.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::parser::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
/// Parse a GRANT statement.
pub fn parse_grant(&mut self) -> Result<Statement, ParserError> {
let (privileges, objects) = self.parse_grant_revoke_privileges_objects()?;
Expand Down
2 changes: 1 addition & 1 deletion src/parser/identifier.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::parser::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
/// Parse a simple one-word identifier (possibly quoted, possibly a keyword)
///
/// The `in_table_clause` parameter indicates whether the identifier is a table in a FROM, JOIN, or
Expand Down
2 changes: 1 addition & 1 deletion src/parser/insert.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
/// Parse an INSERT statement, returning a `Box`ed SetExpr
///
/// This is used to reduce the size of the stack frames in debug builds
Expand Down
2 changes: 1 addition & 1 deletion src/parser/install.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::parser::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
/// `INSTALL [extension_name]`
pub fn parse_install(&mut self) -> Result<Statement, ParserError> {
let extension_name = self.parse_identifier(false)?;
Expand Down
2 changes: 1 addition & 1 deletion src/parser/kill.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::parser::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
// KILL [CONNECTION | QUERY | MUTATION] processlist_id
pub fn parse_kill(&mut self) -> Result<Statement, ParserError> {
let modifier_keyword =
Expand Down
2 changes: 1 addition & 1 deletion src/parser/listen.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::parser::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
pub fn parse_listen(&mut self) -> Result<Statement, ParserError> {
let channel = self.parse_identifier(false)?;
Ok(Statement::LISTEN { channel })
Expand Down
2 changes: 1 addition & 1 deletion src/parser/load.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::parser::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
/// Parse a SQL LOAD statement
pub fn parse_load(&mut self) -> Result<Statement, ParserError> {
if self.dialect.supports_load_extension() {
Expand Down
2 changes: 1 addition & 1 deletion src/parser/merge.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::parser::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
pub fn parse_merge(&mut self) -> Result<Statement, ParserError> {
let into = self.parse_keyword(Keyword::INTO);

Expand Down
2 changes: 1 addition & 1 deletion src/parser/msck.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::parser::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
pub fn parse_msck(&mut self) -> Result<Statement, ParserError> {
let repair = self.parse_keyword(Keyword::REPAIR);
self.expect_keyword(Keyword::TABLE)?;
Expand Down
2 changes: 1 addition & 1 deletion src/parser/notify.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::parser::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
pub fn parse_notify(&mut self) -> Result<Statement, ParserError> {
let channel = self.parse_identifier(false)?;
let payload = if self.consume_token(&Token::Comma) {
Expand Down
2 changes: 1 addition & 1 deletion src/parser/optimize.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::parser::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
/// ```sql
/// OPTIMIZE TABLE [db.]name [ON CLUSTER cluster] [PARTITION partition | PARTITION ID 'partition_id'] [FINAL] [DEDUPLICATE [BY expression]]
/// ```
Expand Down
2 changes: 1 addition & 1 deletion src/parser/options.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::parser::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
pub fn maybe_parse_options(
&mut self,
keyword: Keyword,
Expand Down
2 changes: 1 addition & 1 deletion src/parser/pragma.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::parser::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
// PRAGMA [schema-name '.'] pragma-name [('=' pragma-value) | '(' pragma-value ')']
pub fn parse_pragma(&mut self) -> Result<Statement, ParserError> {
let name = self.parse_object_name(false)?;
Expand Down
2 changes: 1 addition & 1 deletion src/parser/prepare.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::parser::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
pub fn parse_prepare(&mut self) -> Result<Statement, ParserError> {
let name = self.parse_identifier(false)?;

Expand Down
2 changes: 1 addition & 1 deletion src/parser/release.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::parser::*;

impl<'a> Parser<'a> {
impl Parser<'_> {
pub fn parse_release(&mut self) -> Result<Statement, ParserError> {
let _ = self.parse_keyword(Keyword::SAVEPOINT);
let name = self.parse_identifier(false)?;
Expand Down
2 changes: 1 addition & 1 deletion src/parser/replace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::parser::*;

use crate::parser_err;

impl<'a> Parser<'a> {
impl Parser<'_> {
/// Parse an REPLACE statement
pub fn parse_replace(&mut self) -> Result<Statement, ParserError> {
if !dialect_of!(self is MySqlDialect | GenericDialect) {
Expand Down
Loading

0 comments on commit d1c90b2

Please sign in to comment.