Auto merge of #17883 - frewsxcv:frewsxcxv-lowercase, r=SimonSapin

Audit usages of unicode case-changing methods.

Part of https://github.com/servo/servo/issues/17777.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17883)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-08-02 03:01:26 -05:00 committed by GitHub
commit 5fff90c73f
10 changed files with 46 additions and 48 deletions

View file

@ -3875,8 +3875,7 @@ fn update_with_current_time_ms(marker: &Cell<u64>) {
/// https://w3c.github.io/webappsec-referrer-policy/#determine-policy-for-token
pub fn determine_policy_for_token(token: &str) -> Option<ReferrerPolicy> {
let lower = token.to_lowercase();
return match lower.as_ref() {
match_ignore_ascii_case! { token,
"never" | "no-referrer" => Some(ReferrerPolicy::NoReferrer),
"default" | "no-referrer-when-downgrade" => Some(ReferrerPolicy::NoReferrerWhenDowngrade),
"origin" => Some(ReferrerPolicy::Origin),