aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/main/layout
diff options
context:
space:
mode:
authorKeegan McAllister <kmcallister@mozilla.com>2013-08-09 13:41:10 -0700
committerKeegan McAllister <kmcallister@mozilla.com>2013-08-15 13:55:40 -0700
commitffe60ea02704c0bd4545a194bff3f2feafd0133c (patch)
tree97f40c907aae08235e4bc856681cd1eb6df5a274 /src/components/main/layout
parent907d9f23cf8ab5be112376199c3c57ba9e4a3035 (diff)
downloadservo-ffe60ea02704c0bd4545a194bff3f2feafd0133c.tar.gz
servo-ffe60ea02704c0bd4545a194bff3f2feafd0133c.zip
Trait changes, and eliminate 'copy'
Diffstat (limited to 'src/components/main/layout')
-rw-r--r--src/components/main/layout/box.rs2
-rw-r--r--src/components/main/layout/box_builder.rs2
-rw-r--r--src/components/main/layout/float_context.rs2
-rw-r--r--src/components/main/layout/layout_task.rs2
-rw-r--r--src/components/main/layout/text.rs2
-rw-r--r--src/components/main/layout/util.rs2
6 files changed, 7 insertions, 5 deletions
diff --git a/src/components/main/layout/box.rs b/src/components/main/layout/box.rs
index f9b63ed65ed..38f422a1dff 100644
--- a/src/components/main/layout/box.rs
+++ b/src/components/main/layout/box.rs
@@ -782,7 +782,7 @@ impl RenderBox {
// FIXME: Too much allocation here.
let font_families = do my_style.font_family().map |family| {
match *family {
- CSSFontFamilyFamilyName(ref family_str) => copy *family_str,
+ CSSFontFamilyFamilyName(ref family_str) => (*family_str).clone(),
CSSFontFamilyGenericFamily(Serif) => ~"serif",
CSSFontFamilyGenericFamily(SansSerif) => ~"sans-serif",
CSSFontFamilyGenericFamily(Cursive) => ~"cursive",
diff --git a/src/components/main/layout/box_builder.rs b/src/components/main/layout/box_builder.rs
index 643a7b80b5d..cd11e948ed0 100644
--- a/src/components/main/layout/box_builder.rs
+++ b/src/components/main/layout/box_builder.rs
@@ -269,7 +269,7 @@ impl BoxGenerator {
do node.with_imm_image_element |image_element| {
if image_element.image.is_some() {
// FIXME(pcwalton): Don't copy URLs.
- let url = copy *image_element.image.get_ref();
+ let url = (*image_element.image.get_ref()).clone();
ImageRenderBoxClass(@mut ImageRenderBox::new(base, url, layout_ctx.image_cache))
} else {
info!("Tried to make image box, but couldn't find image. Made generic box \
diff --git a/src/components/main/layout/float_context.rs b/src/components/main/layout/float_context.rs
index 5528d5ae8f7..60bb9595615 100644
--- a/src/components/main/layout/float_context.rs
+++ b/src/components/main/layout/float_context.rs
@@ -10,6 +10,7 @@ use std::util::replace;
use std::vec;
use std::i32::max_value;
+#[deriving(Clone)]
pub enum FloatType{
FloatLeft,
FloatRight
@@ -28,6 +29,7 @@ struct FloatContextBase{
offset: Point2D<Au>
}
+#[deriving(Clone)]
struct FloatData{
bounds: Rect<Au>,
f_type: FloatType
diff --git a/src/components/main/layout/layout_task.rs b/src/components/main/layout/layout_task.rs
index 5170d6f5f88..48c9b347e71 100644
--- a/src/components/main/layout/layout_task.rs
+++ b/src/components/main/layout/layout_task.rs
@@ -181,7 +181,7 @@ impl LayoutTask {
};
// FIXME: Bad copy!
- let doc_url = copy data.url;
+ let doc_url = data.url.clone();
let script_chan = data.script_chan.clone();
debug!("layout: received layout request for: %s", doc_url.to_str());
diff --git a/src/components/main/layout/text.rs b/src/components/main/layout/text.rs
index cf9d8f49bcc..525e6239320 100644
--- a/src/components/main/layout/text.rs
+++ b/src/components/main/layout/text.rs
@@ -50,7 +50,7 @@ pub trait UnscannedMethods {
impl UnscannedMethods for RenderBox {
fn raw_text(&self) -> ~str {
match *self {
- UnscannedTextRenderBoxClass(text_box) => copy text_box.text,
+ UnscannedTextRenderBoxClass(text_box) => text_box.text.clone(),
_ => fail!(~"unsupported operation: box.raw_text() on non-unscanned text box."),
}
}
diff --git a/src/components/main/layout/util.rs b/src/components/main/layout/util.rs
index 00d4dae218c..e851cbb41b8 100644
--- a/src/components/main/layout/util.rs
+++ b/src/components/main/layout/util.rs
@@ -13,7 +13,7 @@ pub struct NodeRange {
impl NodeRange {
pub fn new(node: AbstractNode<LayoutView>, range: &Range) -> NodeRange {
- NodeRange { node: node, range: copy *range }
+ NodeRange { node: node, range: (*range).clone() }
}
}