aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/main/layout/text.rs
diff options
context:
space:
mode:
authorMs2ger <ms2ger@gmail.com>2014-05-08 23:40:15 +0200
committerJack Moffitt <jack@metajack.im>2014-05-22 16:36:40 -0600
commiteaedeb07cb0c4fdda37f35057588e4a769fbe758 (patch)
treecdeb134482f06818f7d6dbad8e008882fcc336a5 /src/components/main/layout/text.rs
parent3644d0272c89336954358eb5005f884a9c89e8bc (diff)
downloadservo-eaedeb07cb0c4fdda37f35057588e4a769fbe758.tar.gz
servo-eaedeb07cb0c4fdda37f35057588e4a769fbe758.zip
Update Rust.
Diffstat (limited to 'src/components/main/layout/text.rs')
-rw-r--r--src/components/main/layout/text.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/components/main/layout/text.rs b/src/components/main/layout/text.rs
index 7f38a617efd..2d08bf38019 100644
--- a/src/components/main/layout/text.rs
+++ b/src/components/main/layout/text.rs
@@ -151,8 +151,8 @@ impl TextRunScanner {
// font group fonts. This is probably achieved by creating the font group above
// and then letting `FontGroup` decide which `Font` to stick into the text run.
let fontgroup = font_context.get_resolved_font_for_style(&font_style);
- let run = ~fontgroup.borrow().create_textrun(transformed_text.clone(),
- decoration);
+ let run = box fontgroup.borrow().create_textrun(
+ transformed_text.clone(), decoration);
debug!("TextRunScanner: pushing single text box in range: {} ({})",
self.clump,
@@ -210,7 +210,7 @@ impl TextRunScanner {
// Next, concatenate all of the transformed strings together, saving the new
// character indices.
- let mut run_str: ~str = "".to_owned();
+ let mut run_str = StrBuf::new();
let mut new_ranges: Vec<Range<CharIndex>> = vec![];
let mut char_total = CharIndex(0);
for i in range(0, transformed_strs.len() as int) {
@@ -225,8 +225,9 @@ impl TextRunScanner {
// sequence. If no clump takes ownership, however, it will leak.
let clump = self.clump;
let run = if clump.length() != CharIndex(0) && run_str.len() > 0 {
- Some(Arc::new(~TextRun::new(&mut *fontgroup.borrow().fonts.get(0).borrow_mut(),
- run_str.clone(), decoration)))
+ Some(Arc::new(box TextRun::new(
+ &mut *fontgroup.borrow().fonts.get(0).borrow_mut(),
+ run_str.into_owned(), decoration)))
} else {
None
};