[librsvg: 9/10] Remove borrow::Cow usage since it's not really helpfull.



commit 68536fb1e709c61194322b4068fd6613b5305cee
Author: Jordan Petridis <jordanpetridis protonmail com>
Date:   Sat Dec 9 12:04:23 2017 +0200

    Remove borrow::Cow usage since it's not really helpfull.
    
    Revert "Change the signature of the whitespace normalizer functions."
    
    This reverts commit 4a6be7c7a0ca3c6ac58757b2011374d3a1ad263d.

 rust/src/space.rs | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
---
diff --git a/rust/src/space.rs b/rust/src/space.rs
index 42b2f1f..4fe3bc1 100644
--- a/rust/src/space.rs
+++ b/rust/src/space.rs
@@ -1,7 +1,6 @@
 use libc;
 use glib::translate::*;
 use itertools::Itertools;
-use std::borrow::Cow;
 
 #[repr(C)]
 #[derive(Debug, Copy, Clone, PartialEq, Eq)]
@@ -30,8 +29,7 @@ pub fn xml_space_normalize(mode: XmlSpace, 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<'a, S: Into<Cow<'a, str>>>(s: S) -> String {
-    let s = s.into();
+fn normalize_default(s: &str) -> String {
     s.trim()
         .chars()
         .filter(|ch| *ch != '\n')


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