cargo fmt

This commit is contained in:
Andy Grove 2018-09-03 11:45:03 -06:00
parent dc97d8ef5d
commit 7bea9a8648
4 changed files with 7 additions and 17 deletions

View file

@ -3,13 +3,12 @@ extern crate sqlparser;
use sqlparser::sqlparser::*;
fn main() {
let sql = "SELECT a, b, 123, myfunc(b) \
FROM table_1 \
WHERE a > b AND b < 100 \
ORDER BY a DESC, b";
FROM table_1 \
WHERE a > b AND b < 100 \
ORDER BY a DESC, b";
let ast = Parser::parse_sql(sql.to_string()).unwrap();
println!("AST: {:?}", ast);
}
}

View file

@ -117,7 +117,6 @@ pub enum SQLType {
Time,
/// Timestamp
Timestamp,
}
/// SQL Operator

View file

@ -309,7 +309,6 @@ impl Parser {
true
}
//TODO: this function is inconsistent and sometimes returns bool and sometimes fails
/// Consume the next token if it matches the expected token, otherwise return an error
@ -383,10 +382,7 @@ impl Parser {
}
}
Ok(ASTNode::SQLCreateTable {
name: id,
columns,
})
Ok(ASTNode::SQLCreateTable { name: id, columns })
}
_ => parser_err!(format!(
"Unexpected token after CREATE EXTERNAL TABLE: {:?}",
@ -802,10 +798,7 @@ mod tests {
);
let ast = parse_sql(&sql);
match ast {
ASTNode::SQLCreateTable {
name,
columns,
} => {
ASTNode::SQLCreateTable { name, columns } => {
assert_eq!("uk_cities", name);
assert_eq!(3, columns.len());

View file

@ -166,8 +166,7 @@ impl Tokenizer {
.filter(|t| match t {
Token::Whitespace => false,
_ => true,
})
.collect())
}).collect())
}
/// Get the next token or return None