diff options
author | Jack Moffitt <jack@metajack.im> | 2015-07-31 12:23:13 -0600 |
---|---|---|
committer | Jack Moffitt <jack@metajack.im> | 2015-07-31 12:23:13 -0600 |
commit | dae1a398a43b92aa7390379417e00c7fddb14762 (patch) | |
tree | 5438167f21f59eef23bf0e833bc542c44c96f6e2 /components/layout/inline.rs | |
parent | ca9f9226b092f6f9349aecd53bf0b36fb5b6948e (diff) | |
download | servo-dae1a398a43b92aa7390379417e00c7fddb14762.tar.gz servo-dae1a398a43b92aa7390379417e00c7fddb14762.zip |
Use local slice_chars
StrExt::slice_chars is deprecated and will be removed in Rust. This
lifts the implementation from Rust libstd and puts it in util::str.
This fixes a bunch of deprecation warnings in Servo.
Diffstat (limited to 'components/layout/inline.rs')
-rw-r--r-- | components/layout/inline.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/components/layout/inline.rs b/components/layout/inline.rs index bc5e432a82e..abf23e488dd 100644 --- a/components/layout/inline.rs +++ b/components/layout/inline.rs @@ -35,6 +35,7 @@ use unicode_bidi; use util::geometry::{Au, MAX_AU, ZERO_RECT}; use util::logical_geometry::{LogicalRect, LogicalSize, WritingMode}; use util::range::{Range, RangeIndex}; +use util::str::slice_chars; use util; // From gfxFontConstants.h in Firefox @@ -1801,7 +1802,7 @@ fn strip_trailing_whitespace_if_necessary(text_run: &TextRun, range: &mut Range< debug!("stripping trailing whitespace: range={:?}, len={}", range, text_run.text.chars().count()); - let text = text_run.text.slice_chars(range.begin().to_usize(), range.end().to_usize()); + let text = slice_chars(&*text_run.text, range.begin().to_usize(), range.end().to_usize()); let mut trailing_whitespace_character_count = 0; for ch in text.chars().rev() { if util::str::char_is_whitespace(ch) { |