[librsvg: 2/19] Remove needless return statements




commit 79734386d90a58d815eb2f5bf8c909c571b77e75
Author: Sven Neumann <sven svenfoo org>
Date:   Thu Aug 20 19:12:57 2020 +0200

    Remove needless return statements
    
    See https://rust-lang.github.io/rust-clippy/master/index.html#needless_return

 rsvg_internals/src/path_parser.rs | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)
---
diff --git a/rsvg_internals/src/path_parser.rs b/rsvg_internals/src/path_parser.rs
index 9154a36d9..d88c45e8d 100644
--- a/rsvg_internals/src/path_parser.rs
+++ b/rsvg_internals/src/path_parser.rs
@@ -42,8 +42,8 @@ impl<'a> Lexer<'_> {
         let current = ci.next();
         Lexer {
             input: input.as_bytes(),
-            ci: ci,
-            current: current,
+            ci,
+            current,
             flags_required: 0,
         }
     }
@@ -74,22 +74,20 @@ impl<'a> Lexer<'_> {
 
     fn advance_over_whitespace(&mut self) -> bool {
         let mut found_some = false;
-
         while self.current.is_some() && self.current.unwrap().1.is_ascii_whitespace() {
             found_some = true;
             self.current = self.ci.next();
         }
-
-        return found_some;
+        found_some
     }
 
     fn advance_over_optional(&mut self, needle: u8) -> bool {
         match self.current {
             Some((_, c)) if c == needle => {
                 self.advance();
-                return true;
+                true
             }
-            _ => return false,
+            _ => false,
         }
     }
 
@@ -99,8 +97,7 @@ impl<'a> Lexer<'_> {
             found_some = true;
             self.current = self.ci.next();
         }
-
-        return found_some;
+        found_some
     }
 
     fn advance_over_simple_number(&mut self) -> bool {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]