Skip to content

fix manual ascii checks#835

Closed
pawel-big-lebowski wants to merge 1 commit into
apache:mainfrom
pawel-big-lebowski:fix-ci-manual-is-ascii-check
Closed

fix manual ascii checks#835
pawel-big-lebowski wants to merge 1 commit into
apache:mainfrom
pawel-big-lebowski:fix-ci-manual-is-ascii-check

Conversation

@pawel-big-lebowski

@pawel-big-lebowski pawel-big-lebowski commented Mar 13, 2023

Copy link
Copy Markdown
Contributor

manual_is_ascii_check was added in 1.67.0. Example:

fn main() {
    assert!(matches!('x', 'a'..='z'));
    assert!(matches!(b'X', b'A'..=b'Z'));
    assert!(matches!('2', '0'..='9'));
    assert!(matches!('x', 'A'..='Z' | 'a'..='z'));

    ('0'..='9').contains(&'0');
    ('a'..='z').contains(&'a');
    ('A'..='Z').contains(&'A');
}

Use instead:

fn main() {
    assert!('x'.is_ascii_lowercase());
    assert!(b'X'.is_ascii_uppercase());
    assert!('2'.is_ascii_digit());
    assert!('x'.is_ascii_alphabetic());

    '0'.is_ascii_digit();
    'a'.is_ascii_lowercase();
    'A'.is_ascii_uppercase();
}

I think this is the cause of failing lint for PRs:

@coveralls

coveralls commented Mar 13, 2023

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 4403042910

  • 39 of 39 (100.0%) changed or added relevant lines in 12 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.02%) to 86.113%

Files with Coverage Reduction New Missed Lines %
src/parser.rs 1 82.99%
Totals Coverage Status
Change from base Build 4374743456: -0.02%
Covered Lines: 13481
Relevant Lines: 15655

💛 - Coveralls

@pawel-big-lebowski pawel-big-lebowski force-pushed the fix-ci-manual-is-ascii-check branch 3 times, most recently from 270f701 to 43b4682 Compare March 13, 2023 08:48
Signed-off-by: Pawel Leszczynski <leszczynski.pawel@gmail.com>
@ankrgyl

ankrgyl commented Mar 18, 2023

Copy link
Copy Markdown
Contributor

Can you add some test cases that demonstrate the need for this change?

@alamb

alamb commented Mar 18, 2023

Copy link
Copy Markdown
Contributor

Can you add some test cases that demonstrate the need for this change?

I think this change is needed because the new version of clippy got stricter and the CI checks run on the latest rust language version

Thus clippy will fail on CI unless this is fixed

@alamb

alamb commented Mar 18, 2023

Copy link
Copy Markdown
Contributor

I thought these changes were already made in #832

@pawel-big-lebowski

Copy link
Copy Markdown
Contributor Author

This was fixed in the meantime within other PR. closing.

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.

4 participants