[librsvg] Align::parse_xy() - Take the full ident, not the &str version



commit 6169934bdbd7e933a39fd95abcf019611de1c2cf
Author: Federico Mena Quintero <federico gnome org>
Date:   Fri Sep 14 11:52:10 2018 -0500

    Align::parse_xy() - Take the full ident, not the &str version

 rsvg_internals/src/aspect_ratio.rs | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/rsvg_internals/src/aspect_ratio.rs b/rsvg_internals/src/aspect_ratio.rs
index b4c61ebd..9c48951b 100644
--- a/rsvg_internals/src/aspect_ratio.rs
+++ b/rsvg_internals/src/aspect_ratio.rs
@@ -20,8 +20,8 @@
 //! [`AspectRatio`]: struct.AspectRatio.html
 //! [spec]: https://www.w3.org/TR/SVG/coords.html#PreserveAspectRatioAttribute
 
-use cssparser::Parser;
-use error::*;
+use cssparser::{CowRcStr, Parser};
+use error::ValueErrorKind;
 use parsers::Parse;
 use parsers::ParseError;
 use std::ops::Deref;
@@ -153,10 +153,10 @@ impl AspectRatio {
 }
 
 impl Align {
-    fn parse_xy(s: &str) -> Result<Option<(X, Y)>, ValueErrorKind> {
+    fn parse_xy(ident: &CowRcStr) -> Result<Option<(X, Y)>, ValueErrorKind> {
         use self::Align1D::*;
 
-        match s {
+        match ident.as_ref() {
             "none" => Ok(None),
 
             "xMinYMin" => Ok(Some((X(Min), Y(Min)))),


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