[librsvg: 5/9] Remove redundant clone() of values that are going to be dropped
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 5/9] Remove redundant clone() of values that are going to be dropped
- Date: Sat, 1 Feb 2020 19:07:59 +0000 (UTC)
commit 61ce4612b1a05fa492e2bd3e2c81604a3f9df643
Author: Sven Neumann <sven svenfoo org>
Date: Thu Jan 30 08:51:34 2020 +0100
Remove redundant clone() of values that are going to be dropped
https://rust-lang.github.io/rust-clippy/master/index.html#redundant_clone
rsvg_internals/src/document.rs | 4 ++--
rsvg_internals/src/drawing_ctx.rs | 7 ++-----
2 files changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/rsvg_internals/src/document.rs b/rsvg_internals/src/document.rs
index c4b1ee57..f111f32a 100644
--- a/rsvg_internals/src/document.rs
+++ b/rsvg_internals/src/document.rs
@@ -359,11 +359,11 @@ impl DocumentBuilder {
Some(root) => {
if root.borrow().get_type() == NodeType::Svg {
let mut document = Document {
- tree: root.clone(),
+ tree: root,
ids,
externs: RefCell::new(Resources::new()),
images: RefCell::new(Images::new()),
- load_options: load_options.clone(),
+ load_options: load_options,
stylesheets,
};
diff --git a/rsvg_internals/src/drawing_ctx.rs b/rsvg_internals/src/drawing_ctx.rs
index 1c63c1a1..306d44a0 100644
--- a/rsvg_internals/src/drawing_ctx.rs
+++ b/rsvg_internals/src/drawing_ctx.rs
@@ -724,7 +724,7 @@ impl<'i> DrawingCtx<'i> {
// FIXME: deal with out of memory here
filters::render(&filter_node, values, child_surface, self, node_bbox)
} else {
- Ok(child_surface.clone())
+ Ok(child_surface)
}
}
@@ -1437,10 +1437,7 @@ impl<'i> AcquiredNodes<'i> {
if node_is_accessed_by_reference(&node) {
self.acquire_ref(&node)
} else {
- Ok(AcquiredNode {
- stack: None,
- node: node.clone(),
- })
+ Ok(AcquiredNode { stack: None, node })
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]