[librsvg: 3/17] Stylesheet::parse - make private




commit fb64f161908eec5c0395640f6b055b3e2800d40f
Author: Federico Mena Quintero <federico gnome org>
Date:   Mon Aug 29 12:54:19 2022 -0500

    Stylesheet::parse - make private
    
    Replace its only caller with a call to Stylesheet::from_data().
    
    Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/738>

 src/css.rs    | 2 +-
 src/handle.rs | 8 ++++++--
 2 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/css.rs b/src/css.rs
index 43195eb92..de3ffb898 100644
--- a/src/css.rs
+++ b/src/css.rs
@@ -831,7 +831,7 @@ impl Stylesheet {
     ///
     /// The `base_url` is required for `@import` rules, so that librsvg
     /// can determine if the requested path is allowed.
-    pub fn parse(
+    fn parse(
         &mut self,
         buf: &str,
         url_resolver: &UrlResolver,
diff --git a/src/handle.rs b/src/handle.rs
index 62cd9a1ec..6fa7e5bb3 100644
--- a/src/handle.rs
+++ b/src/handle.rs
@@ -371,8 +371,12 @@ impl Handle {
     }
 
     pub fn set_stylesheet(&mut self, css: &str) -> Result<(), LoadingError> {
-        let mut stylesheet = Stylesheet::new(Origin::User);
-        stylesheet.parse(css, &UrlResolver::new(None), self.session.clone())?;
+        let stylesheet = Stylesheet::from_data(
+            css,
+            &UrlResolver::new(None),
+            Origin::User,
+            self.session.clone(),
+        )?;
         self.document.cascade(&[stylesheet], &self.session);
         Ok(())
     }


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