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

Implement Option::take() #7865

Closed
wants to merge 2 commits into from
Closed

Implement Option::take() #7865

wants to merge 2 commits into from

Conversation

bluss
Copy link
Member

@bluss bluss commented Jul 17, 2013

Implement Option::take() that replaces the value with None, and returns the Option value as it was.

As mentioned in issue #7764

blake2-ppc added 2 commits July 17, 2013 23:48
This operation is a component of .take_unwrap() and a common use of
util::replace.
@bluss
Copy link
Member Author

bluss commented Jul 18, 2013

Redundant with pull #7858

@bluss bluss closed this Jul 18, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Nov 4, 2021
…r=xFrednet

Fix `match_str_case_mismatch` on uncased chars

False positives would result because `char::is_lowercase` and friends will return `false` for non-alphabetic chars and alphabetic chars lacking case (such as CJK scripts). Care also has to be taken for handling titlecase characters (`Dz`) and lowercased chars with no uppercase equivalent (`ʁ`).

For example, when verifying lowercase:
 * Check `!any(char::is_ascii_uppercase)` instead of `all(char::is_ascii_lowercase)` for ASCII.
 * Check that `all(|c| c.to_lowercase() == c)` instead of `all(char::is_lowercase)` for non-ASCII

Fixes rust-lang#7863.

changelog: Fix false positives in [`match_str_case_mismatch`] on uncased characters
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.

1 participant