diff --git a/src/parser/ast/check.rs b/src/parser/ast/check.rs index c2fb2d8..8fae5ca 100644 --- a/src/parser/ast/check.rs +++ b/src/parser/ast/check.rs @@ -188,7 +188,7 @@ impl CreateTableBody { pub fn check(&self, tbl_name: &QualifiedName) -> Result<(), ParserError> { if let CreateTableBody::ColumnsAndConstraints { columns, - constraints, + constraints: _, options, } = self { @@ -299,7 +299,7 @@ impl OneSelect { } } } - /// + /// Check all VALUES have the same number of terms pub fn push(values: &mut Vec>, v: Vec) -> Result<(), ParserError> { if values[0].len() != v.len() { return Err(custom_err!("all VALUES must have the same number of terms")); diff --git a/src/parser/ast/fmt.rs b/src/parser/ast/fmt.rs index a548b64..94b1fb9 100644 --- a/src/parser/ast/fmt.rs +++ b/src/parser/ast/fmt.rs @@ -2043,7 +2043,7 @@ pub fn dequote(n: Name) -> Result { if s.is_empty() { return Ok(n); } - let mut quote = s.chars().nth(0).unwrap(); + let mut quote = s.chars().next().unwrap(); if quote != '"' && quote != '`' && quote != '\'' && quote != '[' { return Ok(n); } else if quote == '[' { diff --git a/src/parser/ast/mod.rs b/src/parser/ast/mod.rs index b345254..de958f0 100644 --- a/src/parser/ast/mod.rs +++ b/src/parser/ast/mod.rs @@ -867,7 +867,7 @@ pub enum SelectTable { TableCall(QualifiedName, Option>, Option), /// `SELECT` subquery Select(Select, Option), - /// + /// subquery Sub(FromClause, Option), } @@ -1169,7 +1169,7 @@ pub struct NamedColumnConstraint { pub enum ColumnConstraint { /// `PRIMARY KEY` PrimaryKey { - /// + /// `ASC` / `DESC` order: Option, /// `ON CONFLICT` clause conflict_clause: Option, @@ -1178,7 +1178,7 @@ pub enum ColumnConstraint { }, /// `NULL` NotNull { - /// + /// `NOT` nullable: bool, /// `ON CONFLICT` clause conflict_clause: Option, @@ -1294,7 +1294,7 @@ pub struct ForeignKeyClause { pub tbl_name: Name, /// foreign table columns pub columns: Option>, - /// + /// referential action(s) / deferrable option(s) pub args: Vec, } @@ -1469,9 +1469,9 @@ pub enum TriggerCmd { tbl_name: Name, /// `COLUMNS` col_names: Option>, - /// + /// `SELECT` or `VALUES` select: Select, - /// + /// `ON CONLICT` clause upsert: Option, /// `RETURNING` returning: Option>, @@ -1516,7 +1516,7 @@ pub struct With { /// CTE materialization #[derive(Clone, Debug, PartialEq, Eq)] pub enum Materialized { - /// + /// No hint Any, /// `MATERIALIZED` Yes, @@ -1610,7 +1610,7 @@ pub struct UpsertIndex { pub enum UpsertDo { /// `SET` Set { - /// + /// assignments sets: Vec, /// `WHERE` clause where_clause: Option, @@ -1665,11 +1665,11 @@ pub struct Window { // https://sqlite.org/syntax/frame-spec.html #[derive(Clone, Debug, PartialEq, Eq)] pub struct FrameClause { - /// + /// unit pub mode: FrameMode, - /// + /// start bound pub start: FrameBound, - /// + /// end bound pub end: Option, /// `EXCLUDE` pub exclude: Option, diff --git a/src/parser/mod.rs b/src/parser/mod.rs index f249de3..62f345b 100644 --- a/src/parser/mod.rs +++ b/src/parser/mod.rs @@ -24,9 +24,9 @@ pub enum ParserError { StackOverflow, /// Syntax error SyntaxError { - /// + /// token type token_type: &'static str, - /// + /// token value found: Option, }, /// Unexpected EOF