[librsvg: 1/2] space.rs: make function argument variable mutable



commit 60a4d73fc9fb5ec660b539875d6a02f56a48d612
Author: Jordan Petridis <jpetridis gnome org>
Date:   Mon Oct 28 17:52:32 2019 +0200

    space.rs: make function argument variable mutable
    
    This makes it so though, the function body can override the variable `s`
    and this doesn't affect the type of the argument or makes the
    string mutable.

 rsvg_internals/src/space.rs | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
---
diff --git a/rsvg_internals/src/space.rs b/rsvg_internals/src/space.rs
index 26276f45..4f5eee67 100644
--- a/rsvg_internals/src/space.rs
+++ b/rsvg_internals/src/space.rs
@@ -30,9 +30,7 @@ pub fn xml_space_normalize(mode: XmlSpaceNormalize, s: &str) -> String {
 // characters into space characters. Then, it will strip off all
 // leading and trailing space characters. Then, all contiguous space
 // characters will be consolidated.
-fn normalize_default(elements: NormalizeDefault, s: &str) -> String {
-    let mut s = s;
-
+fn normalize_default(elements: NormalizeDefault, mut s: &str) -> String {
     if !elements.has_element_before {
         s = s.trim_start();
     }


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