diff options
author | Ms2ger <ms2ger@gmail.com> | 2015-01-22 13:49:10 +0100 |
---|---|---|
committer | Ms2ger <ms2ger@gmail.com> | 2015-01-22 14:49:26 +0100 |
commit | 024571dfa38dbe63cb2a591571e2465b5d882686 (patch) | |
tree | a6c64b523b0c6fff10fe4c58587cfcb697915140 /components/script/textinput.rs | |
parent | faefb27f3e8daed229bc8f15956e314fc01e31d9 (diff) | |
download | servo-024571dfa38dbe63cb2a591571e2465b5d882686.tar.gz servo-024571dfa38dbe63cb2a591571e2465b5d882686.zip |
Use chars().count() rather than char_len().
The latter is obsolete in current Rust.
Diffstat (limited to 'components/script/textinput.rs')
-rw-r--r-- | components/script/textinput.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/components/script/textinput.rs b/components/script/textinput.rs index c2c183d022c..4c4226738cf 100644 --- a/components/script/textinput.rs +++ b/components/script/textinput.rs @@ -135,7 +135,7 @@ impl TextInput { let new_lines = { let prefix = self.lines[begin.line].slice_chars(0, begin.index); - let suffix = self.lines[end.line].slice_chars(end.index, self.lines[end.line].char_len()); + let suffix = self.lines[end.line].slice_chars(end.index, self.lines[end.line].chars().count()); let lines_prefix = self.lines.slice(0, begin.line); let lines_suffix = self.lines.slice(end.line + 1, self.lines.len()); @@ -150,7 +150,7 @@ impl TextInput { insert_lines[0] = new_line; let last_insert_lines_index = insert_lines.len() - 1; - self.edit_point.index = insert_lines[last_insert_lines_index].char_len(); + self.edit_point.index = insert_lines[last_insert_lines_index].chars().count(); self.edit_point.line = begin.line + last_insert_lines_index; insert_lines[last_insert_lines_index].push_str(suffix); @@ -167,7 +167,7 @@ impl TextInput { /// Return the length of the current line under the editing point. fn current_line_length(&self) -> uint { - self.lines[self.edit_point.line].char_len() + self.lines[self.edit_point.line].chars().count() } /// Adjust the editing point position by a given of lines. The resulting column is @@ -260,7 +260,7 @@ impl TextInput { }); let last_line = self.lines.len() - 1; self.edit_point.line = last_line; - self.edit_point.index = self.lines[last_line].char_len(); + self.edit_point.index = self.lines[last_line].chars().count(); } /// Remove the current selection. |