Skip to content

Commit

Permalink
Merge pull request #54 from gwenn/clippy
Browse files Browse the repository at this point in the history
Fix clippy warnings
  • Loading branch information
gwenn authored Mar 24, 2024
2 parents 7edcf6b + f6ee055 commit ba9a7d2
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/parser/ast/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ impl CreateTableBody {
pub fn check(&self, tbl_name: &QualifiedName) -> Result<(), ParserError> {
if let CreateTableBody::ColumnsAndConstraints {
columns,
constraints,
constraints: _,
options,
} = self
{
Expand Down Expand Up @@ -299,7 +299,7 @@ impl OneSelect {
}
}
}
///
/// Check all VALUES have the same number of terms
pub fn push(values: &mut Vec<Vec<Expr>>, v: Vec<Expr>) -> Result<(), ParserError> {
if values[0].len() != v.len() {
return Err(custom_err!("all VALUES must have the same number of terms"));
Expand Down
2 changes: 1 addition & 1 deletion src/parser/ast/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2043,7 +2043,7 @@ pub fn dequote(n: Name) -> Result<Name, ParserError> {
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 == '[' {
Expand Down
22 changes: 11 additions & 11 deletions src/parser/ast/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ pub enum SelectTable {
TableCall(QualifiedName, Option<Vec<Expr>>, Option<As>),
/// `SELECT` subquery
Select(Select, Option<As>),
///
/// subquery
Sub(FromClause, Option<As>),
}

Expand Down Expand Up @@ -1169,7 +1169,7 @@ pub struct NamedColumnConstraint {
pub enum ColumnConstraint {
/// `PRIMARY KEY`
PrimaryKey {
///
/// `ASC` / `DESC`
order: Option<SortOrder>,
/// `ON CONFLICT` clause
conflict_clause: Option<ResolveType>,
Expand All @@ -1178,7 +1178,7 @@ pub enum ColumnConstraint {
},
/// `NULL`
NotNull {
///
/// `NOT`
nullable: bool,
/// `ON CONFLICT` clause
conflict_clause: Option<ResolveType>,
Expand Down Expand Up @@ -1294,7 +1294,7 @@ pub struct ForeignKeyClause {
pub tbl_name: Name,
/// foreign table columns
pub columns: Option<Vec<IndexedColumn>>,
///
/// referential action(s) / deferrable option(s)
pub args: Vec<RefArg>,
}

Expand Down Expand Up @@ -1469,9 +1469,9 @@ pub enum TriggerCmd {
tbl_name: Name,
/// `COLUMNS`
col_names: Option<Vec<Name>>,
///
/// `SELECT` or `VALUES`
select: Select,
///
/// `ON CONLICT` clause
upsert: Option<Upsert>,
/// `RETURNING`
returning: Option<Vec<ResultColumn>>,
Expand Down Expand Up @@ -1516,7 +1516,7 @@ pub struct With {
/// CTE materialization
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum Materialized {
///
/// No hint
Any,
/// `MATERIALIZED`
Yes,
Expand Down Expand Up @@ -1610,7 +1610,7 @@ pub struct UpsertIndex {
pub enum UpsertDo {
/// `SET`
Set {
///
/// assignments
sets: Vec<Set>,
/// `WHERE` clause
where_clause: Option<Expr>,
Expand Down Expand Up @@ -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<FrameBound>,
/// `EXCLUDE`
pub exclude: Option<FrameExclude>,
Expand Down
4 changes: 2 additions & 2 deletions src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ pub enum ParserError {
StackOverflow,
/// Syntax error
SyntaxError {
///
/// token type
token_type: &'static str,
///
/// token value
found: Option<String>,
},
/// Unexpected EOF
Expand Down

0 comments on commit ba9a7d2

Please sign in to comment.