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

style: Fix starts_with_ignore_ascii_case. #17640

Merged
merged 2 commits into from
Jul 8, 2017

Conversation

emilio
Copy link
Member

@emilio emilio commented Jul 8, 2017

In particular, fix a panic when the input is not ASCII and we happen to index in
something that is not a char boundary.

This fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1379380


This change is Reviewable

In particular, fix a panic when the input is not ASCII and we happen to index in
something that is not a char boundary.

This fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1379380
@highfive
Copy link

highfive commented Jul 8, 2017

Heads up! This PR modifies the following files:

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jul 8, 2017
@@ -149,5 +149,5 @@ pub fn str_join<I, T>(strs: I, join: &str) -> String
/// Returns true if a given string has a given prefix with case-insensitive match.
pub fn starts_with_ignore_ascii_case(string: &str, prefix: &str) -> bool {
string.len() > prefix.len() &&
Copy link
Member Author

Choose a reason for hiding this comment

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

I guess this should technically be >= (though it doesn't matter due to the callsites). I'll fix too.

@emilio
Copy link
Member Author

emilio commented Jul 8, 2017

r? @nox or @SimonSapin (or anyone else really)

@highfive highfive assigned nox and unassigned metajack Jul 8, 2017
@emilio
Copy link
Member Author

emilio commented Jul 8, 2017

@bors-servo r=stshine

@bors-servo
Copy link
Contributor

📌 Commit 9e00efc has been approved by stshine

@highfive highfive assigned stshine and unassigned nox Jul 8, 2017
@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Jul 8, 2017
@bors-servo
Copy link
Contributor

⌛ Testing commit 9e00efc with merge 104e0b4...

bors-servo pushed a commit that referenced this pull request Jul 8, 2017
style: Fix starts_with_ignore_ascii_case.

In particular, fix a panic when the input is not ASCII and we happen to index in
something that is not a char boundary.

This fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1379380

<!-- 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/17640)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, windows-msvc-dev
Approved by: stshine
Pushing 104e0b4 to master...

@bors-servo bors-servo merged commit 9e00efc into servo:master Jul 8, 2017
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jul 8, 2017
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.

6 participants