diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-05-24 07:42:23 -0700 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2016-05-24 07:42:23 -0700 |
commit | 8c4929a196ca933532d0c6948c9eebd92be4013a (patch) | |
tree | 4fcf03339f728040fdbbcc7ead9bdf5113e3269a /components/util/str.rs | |
parent | cd1396fa9ae72bebf13115ed0d752fb21ce0df19 (diff) | |
parent | c93ed39f3366b8a3b889884b0bdab30c1fadbde1 (diff) | |
download | servo-8c4929a196ca933532d0c6948c9eebd92be4013a.tar.gz servo-8c4929a196ca933532d0c6948c9eebd92be4013a.zip |
Auto merge of #10962 - KiChjang:input-attr-parse, r=asajeffrey
Parse HTMLInputElement attributes
Fixes #10491.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10962)
<!-- Reviewable:end -->
Diffstat (limited to 'components/util/str.rs')
-rw-r--r-- | components/util/str.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/components/util/str.rs b/components/util/str.rs index fe23c1b5ff6..7af63f4c7f3 100644 --- a/components/util/str.rs +++ b/components/util/str.rs @@ -41,6 +41,10 @@ pub fn split_html_space_chars<'a>(s: &'a str) -> s.split(HTML_SPACE_CHARACTERS).filter(not_empty as fn(&&str) -> bool) } +pub fn split_commas<'a>(s: &'a str) -> Filter<Split<'a, char>, fn(&&str) -> bool> { + fn not_empty(&split: &&str) -> bool { !split.is_empty() } + s.split(',').filter(not_empty as fn(&&str) -> bool) +} fn is_ascii_digit(c: &char) -> bool { match *c { |