diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-07-31 12:54:49 -0600 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-07-31 12:54:49 -0600 |
commit | a54404c92180b839d2cf089d9ec9a6afe8bd5ba3 (patch) | |
tree | 08fb013f6d9e437e15893796068f8d8e06bf1a91 /components/layout/inline.rs | |
parent | 7e772857458f60a68346ac1a7020ae51d65959a1 (diff) | |
parent | dae1a398a43b92aa7390379417e00c7fddb14762 (diff) | |
download | servo-a54404c92180b839d2cf089d9ec9a6afe8bd5ba3.tar.gz servo-a54404c92180b839d2cf089d9ec9a6afe8bd5ba3.zip |
Auto merge of #6876 - metajack:slice_chars-layout, r=pcwalton
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.
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6876)
<!-- Reviewable:end -->
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) { |