[librsvg: 1/2] text: Add explicit lifetime to an impl block



commit 95376c378fd9ed6b60cbbb6f1ea6c3b6b056788c
Author: Jordan Petridis <jpetridis gnome org>
Date:   Fri Jan 4 10:24:21 2019 +0200

    text: Add explicit lifetime to an impl block
    
    While building with rustc <= 1.31 the following error would occur.
    
    error[E0106]: missing lifetime specifier
       --> rsvg_internals/src/text.rs:794:11
        |
    794 | impl From<&XmlLang> for pango::Language {
        |           ^ expected lifetime parameter
    
    error: aborting due to previous error
    
    The lifetime is not required with rustc 1.31+ and can be omitted,
    but we still need to support older versions for the time being.

 rsvg_internals/src/text.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/rsvg_internals/src/text.rs b/rsvg_internals/src/text.rs
index a2abfccd..1c929e3c 100644
--- a/rsvg_internals/src/text.rs
+++ b/rsvg_internals/src/text.rs
@@ -791,8 +791,8 @@ fn to_pango_units(v: f64) -> i32 {
     (v * f64::from(pango::SCALE) + 0.5) as i32
 }
 
-impl From<&XmlLang> for pango::Language {
-    fn from(l: &XmlLang) -> pango::Language {
+impl<'a> From<&'a XmlLang> for pango::Language {
+    fn from(l: &'a XmlLang) -> pango::Language {
         pango::Language::from_string(&l.0)
     }
 }


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