diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-07-08 19:41:28 +0200 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-07-08 19:41:28 +0200 |
commit | 9e00efc8a57b43bf12022286155e77a1dd043bde (patch) | |
tree | fd276585956f30ccbe73ea8bcc11d1a0361a1675 /components | |
parent | d8a22d8bd764af422a5598b745b8f1474d07f400 (diff) | |
download | servo-9e00efc8a57b43bf12022286155e77a1dd043bde.tar.gz servo-9e00efc8a57b43bf12022286155e77a1dd043bde.zip |
style: Make starts_with_ignore_ascii_case not lie if the strings are the same length.
Diffstat (limited to 'components')
-rw-r--r-- | components/style/str.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/components/style/str.rs b/components/style/str.rs index 70fbe538533..92febb40824 100644 --- a/components/style/str.rs +++ b/components/style/str.rs @@ -148,6 +148,6 @@ 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() && + string.len() >= prefix.len() && string.as_bytes()[0..prefix.len()].eq_ignore_ascii_case(prefix.as_bytes()) } |