Skip to content

Rust 2018 and clippy fixes - #51

Merged
andygrove merged 9 commits into
apache:masterfrom
nickolay:rust-2018
Apr 27, 2019
Merged

andygrove merged 9 commits into
apache:masterfrom
nickolay:rust-2018

Conversation

@nickolay

Copy link
Copy Markdown
Contributor

Most of the changes here are uninteresting, except for:

  • The breaking changes to the AST in 50a2310
  • A drive-by bugfix for parsing of the TIME data type in 3df2223
  • The addition of a tiny matches crate to dev-dependencies in 08bbce8

This requires Rust 1.31 (from last year) to build, but is otherwise
compatible with the 2015-edition code.
https://rust-lang.github.io/rust-clippy/master/#if_same_then_else

There was a bug in parsing `TIME` (not followed by {WITH | WITHOUT}
TIME ZONE) -- that parsed as SQLType::Timestamp instead of SQLType::Time
https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_constants

While I don't feel it's valid, fixing it lets us act on the other, more
useful, lints.
To fix clippy warnings about assert!(true / false)
The name was confusing:
SQLStatement::SQLSelect(
  SQLQuery {
    body: SQLSetExpr::Select(SQLSelect)
  }
)

Fix the `large_enum_variant` clippy lint for `SQLStatement::SQLQuery`
`SQLStatement::SQLCreateView`, and `SQLSetExpr::Select`, while we're
changing the AST anyway
https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant
@coveralls

coveralls commented Apr 21, 2019 •

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 154

  • 98 of 135 (72.59%) changed or added relevant lines in 8 files are covered.
  • 4 unchanged lines in 4 files lost coverage.
  • Overall coverage increased (+8.2%) to 92.864%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/sqlast/mod.rs 6 8 75.0%
src/sqlast/sqltype.rs 8 11 72.73%
tests/sqlparser_ansi.rs 6 9 66.67%
tests/sqlparser_generic.rs 21 29 72.41%
src/sqlparser.rs 38 48 79.17%
tests/sqlparser_postgres.rs 10 21 47.62%
Files with Coverage Reduction New Missed Lines %
src/sqlparser.rs 1 82.07%
tests/sqlparser_generic.rs 1 92.31%
src/sqlast/sqltype.rs 1 47.83%
tests/sqlparser_postgres.rs 1 95.24%
Totals Coverage Status
Change from base Build 148: 8.2%
Covered Lines: 911
Relevant Lines: 981

💛 - Coveralls

@andygrove andygrove left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @nickolay

@andygrove
andygrove merged commit 4cdd003 into apache:master Apr 27, 2019
@nickolay
nickolay deleted the rust-2018 branch April 27, 2019 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants