[librsvg: 1/4] surface_utils: rename param for clarity




commit 1aaa1af8866c416dc304e501d3c79829b36eb11f
Author: Paolo Borelli <pborelli gnome org>
Date:   Sun Jan 3 16:44:37 2021 +0100

    surface_utils: rename param for clarity

 src/document.rs                     | 2 +-
 src/surface_utils/shared_surface.rs | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/document.rs b/src/document.rs
index f28316ef..28965b0d 100644
--- a/src/document.rs
+++ b/src/document.rs
@@ -267,7 +267,7 @@ fn load_image(
         None
     };
 
-    let surface = SharedImageSurface::from_pixbuf(&pixbuf, bytes, content_type.as_deref())
+    let surface = SharedImageSurface::from_pixbuf(&pixbuf, content_type.as_deref(), bytes)
         .map_err(|e| image_loading_error_from_cairo(e, aurl))?;
 
     Ok(surface)
diff --git a/src/surface_utils/shared_surface.rs b/src/surface_utils/shared_surface.rs
index 4bf6a822..89fa480c 100644
--- a/src/surface_utils/shared_surface.rs
+++ b/src/surface_utils/shared_surface.rs
@@ -260,8 +260,8 @@ impl ImageSurface<Shared> {
 
     pub fn from_pixbuf(
         pixbuf: &Pixbuf,
-        data: Option<Vec<u8>>,
         content_type: Option<&str>,
+        mime_data: Option<Vec<u8>>,
     ) -> Result<SharedImageSurface, cairo::Status> {
         assert!(pixbuf.get_colorspace() == Colorspace::Rgb);
         assert!(pixbuf.get_bits_per_sample() == 8);
@@ -307,7 +307,7 @@ impl ImageSurface<Shared> {
             }
         }
 
-        if let (Some(bytes), Some(content_type)) = (data, content_type) {
+        if let (Some(content_type), Some(bytes)) = (content_type, mime_data) {
             surf.surface.set_mime_data(content_type, bytes)?;
         }
 


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