aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom')
-rw-r--r--components/script/dom/htmlimageelement.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/components/script/dom/htmlimageelement.rs b/components/script/dom/htmlimageelement.rs
index af503ea2aa8..32818d400e3 100644
--- a/components/script/dom/htmlimageelement.rs
+++ b/components/script/dom/htmlimageelement.rs
@@ -2011,8 +2011,8 @@ pub fn parse_a_srcset_attribute(input: &str) -> Vec<ImageSource> {
// > that position is past the end of input.
let mut characters = descriptors_string.chars();
let mut character = characters.next();
- if character.is_some() {
- current_index += 1;
+ if let Some(character) = character {
+ current_index += character.len_utf8();
}
loop {
@@ -2086,8 +2086,8 @@ pub fn parse_a_srcset_attribute(input: &str) -> Vec<ImageSource> {
}
character = characters.next();
- if character.is_some() {
- current_index += 1;
+ if let Some(character) = character {
+ current_index += character.len_utf8();
}
}