aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/fragment.rs
diff options
context:
space:
mode:
authorbors-servo <metajack+bors@gmail.com>2015-07-31 12:54:49 -0600
committerbors-servo <metajack+bors@gmail.com>2015-07-31 12:54:49 -0600
commita54404c92180b839d2cf089d9ec9a6afe8bd5ba3 (patch)
tree08fb013f6d9e437e15893796068f8d8e06bf1a91 /components/layout/fragment.rs
parent7e772857458f60a68346ac1a7020ae51d65959a1 (diff)
parentdae1a398a43b92aa7390379417e00c7fddb14762 (diff)
downloadservo-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/fragment.rs')
-rw-r--r--components/layout/fragment.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs
index 721d7ea1573..7285adca0e3 100644
--- a/components/layout/fragment.rs
+++ b/components/layout/fragment.rs
@@ -46,7 +46,7 @@ use url::Url;
use util::geometry::{Au, ZERO_POINT};
use util::logical_geometry::{LogicalRect, LogicalSize, LogicalMargin, WritingMode};
use util::range::*;
-use util::str::is_whitespace;
+use util::str::{is_whitespace, slice_chars};
use util;
/// Fragments (`struct Fragment`) are the leaves of the layout tree. They cannot position
@@ -204,8 +204,8 @@ impl fmt::Debug for SpecificFragmentInfo {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
SpecificFragmentInfo::ScannedText(ref info) => {
- write!(f, " \"{}\"", info.run.text.slice_chars(info.range.begin().get() as usize,
- info.range.end().get() as usize))
+ write!(f, " \"{}\"", slice_chars(&*info.run.text, info.range.begin().get() as usize,
+ info.range.end().get() as usize))
}
_ => Ok(())
}
@@ -2094,7 +2094,8 @@ impl Fragment {
let mut leading_whitespace_character_count = 0;
{
- let text = scanned_text_fragment_info.run.text.slice_chars(
+ let text = slice_chars(
+ &*scanned_text_fragment_info.run.text,
scanned_text_fragment_info.range.begin().to_usize(),
scanned_text_fragment_info.range.end().to_usize());
for character in text.chars() {