Skip to content

Minor code clean-ups #110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 9, 2019
Merged

Minor code clean-ups #110

merged 5 commits into from
Jun 9, 2019

Conversation

nickolay
Copy link
Contributor

@nickolay nickolay commented Jun 9, 2019

No description provided.

@nickolay nickolay requested a review from benesch June 9, 2019 14:32
@coveralls
Copy link

coveralls commented Jun 9, 2019

Pull Request Test Coverage Report for Build 324

  • 53 of 54 (98.15%) changed or added relevant lines in 3 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage remained the same at ?%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/sqltokenizer.rs 42 43 97.67%
Files with Coverage Reduction New Missed Lines %
src/sqltokenizer.rs 1 92.68%
Totals Coverage Status
Change from base Build 323: 0.0%
Covered Lines:
Relevant Lines: 0

💛 - Coveralls

Copy link
Contributor

@benesch benesch left a comment

Choose a reason for hiding this comment

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

These all look great! The cleanup for parsing comma-separated lists is particularly nice.

@nickolay nickolay merged commit 518c883 into apache:master Jun 9, 2019
@nickolay nickolay deleted the pr/cleanups branch June 9, 2019 17:24
@nickolay
Copy link
Contributor Author

nickolay commented Jun 9, 2019

Thanks for the review! I've also tried factoring the common parts even further, like:

        let options = self.parse_comma_separated(|parser| {
            let name = parser.parse_identifier()?;
            parser.expect_token(&Token::Eq)?;
            let value = parser.parse_value()?;
            Ok(SQLOption { name, value })
        })?;

..but decided against it for now, as I didn't like that sometimes the parser is referred to as self, and sometimes as parser.

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