Skip to content
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

Fix uppercase and lowercase check #461

Merged
merged 5 commits into from
Oct 22, 2022

Conversation

harupy
Copy link
Contributor

@harupy harupy commented Oct 22, 2022

string.chars().all(|c| c.is_uppercase|is_lowercase()) retruns False when string contains _. This PR fixes it.

Comment on lines +117 to +127
fn is_lower(s: &str) -> bool {
let mut cased = false;
for c in s.chars() {
if c.is_uppercase() {
return false;
} else if !cased && c.is_lowercase() {
cased = true;
}
}
cased
}
Copy link
Contributor Author

@harupy harupy Oct 22, 2022

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Awesome, can we add a test or two for these functions?

@charliermarsh charliermarsh merged commit b75ea94 into astral-sh:main Oct 22, 2022
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.

None yet

2 participants