[librsvg: 13/19] Avoid cloning an owned value that is going to be dropped
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 13/19] Avoid cloning an owned value that is going to be dropped
- Date: Fri, 21 Aug 2020 18:30:17 +0000 (UTC)
commit 7bac028ec6ac0e93950a8188f75a6debd06b19bb
Author: Sven Neumann <sven svenfoo org>
Date: Fri Aug 21 01:03:58 2020 +0200
Avoid cloning an owned value that is going to be dropped
See https://rust-lang.github.io/rust-clippy/master/index.html#redundant_clone
rsvg_internals/src/document.rs | 5 +----
rsvg_internals/src/drawing_ctx.rs | 2 +-
2 files changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/rsvg_internals/src/document.rs b/rsvg_internals/src/document.rs
index b57197c05..f504ef137 100644
--- a/rsvg_internals/src/document.rs
+++ b/rsvg_internals/src/document.rs
@@ -311,10 +311,7 @@ impl<'i> AcquiredNodes<'i> {
if node.borrow_element().is_accessed_by_reference() {
self.acquire_ref(&node)
} else {
- Ok(AcquiredNode {
- stack: None,
- node: node.clone(),
- })
+ Ok(AcquiredNode { stack: None, node })
}
}
diff --git a/rsvg_internals/src/drawing_ctx.rs b/rsvg_internals/src/drawing_ctx.rs
index fa8201c9b..dd6b35d17 100644
--- a/rsvg_internals/src/drawing_ctx.rs
+++ b/rsvg_internals/src/drawing_ctx.rs
@@ -802,7 +802,7 @@ impl DrawingCtx {
}
// Non-existing filters must act as null filters (an empty surface is returned).
- Ok(child_surface.clone())
+ Ok(child_surface)
}
fn set_color(
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]