[librsvg] RsvgLength::check_nonnegative(): Take ownership of self
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [librsvg] RsvgLength::check_nonnegative(): Take ownership of self
- Date: Tue,  5 Sep 2017 15:05:27 +0000 (UTC)
commit 6be9e887e0e752d72d051069fdb0965f8ac749aa
Author: Federico Mena Quintero <federico gnome org>
Date:   Tue Sep 5 08:57:59 2017 -0500
    RsvgLength::check_nonnegative(): Take ownership of self
    
    It's Copy, anyway...
 rust/src/length.rs |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/rust/src/length.rs b/rust/src/length.rs
index e208d37..f1c9a83 100644
--- a/rust/src/length.rs
+++ b/rust/src/length.rs
@@ -196,9 +196,9 @@ impl Parse for RsvgLength {
 }
 
 impl RsvgLength {
-    pub fn check_nonnegative (&self) -> Result <RsvgLength, AttributeError> {
+    pub fn check_nonnegative (self) -> Result <RsvgLength, AttributeError> {
         if self.length >= 0.0 {
-            Ok (*self)
+            Ok (self)
         } else {
             Err (AttributeError::Value ("value must be non-negative".to_string ()))
         }
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]