[librsvg: 19/32] Remove LoadingError::EmptyData




commit 9188f3f8e943940f5a54206174540faecc18a55a
Author: Federico Mena Quintero <federico gnome org>
Date:   Thu Nov 26 16:22:43 2020 -0600

    Remove LoadingError::EmptyData
    
    It was just used internally when loading an empty <image>; we can use
    LoadingError::Other for this.

 src/document.rs | 2 +-
 src/error.rs    | 4 ----
 2 files changed, 1 insertion(+), 5 deletions(-)
---
diff --git a/src/document.rs b/src/document.rs
index 50bed00f..f57dd6af 100644
--- a/src/document.rs
+++ b/src/document.rs
@@ -208,7 +208,7 @@ fn load_image(
     } = io::acquire_data(&aurl, None)?;
 
     if bytes.is_empty() {
-        return Err(LoadingError::EmptyData);
+        return Err(LoadingError::Other(String::from("no image data")));
     }
 
     // See issue #548 - data: URLs without a MIME-type automatically
diff --git a/src/error.rs b/src/error.rs
index 8c9acf9a..bd38955c 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -349,9 +349,6 @@ pub enum LoadingError {
     /// An invalid stylesheet was used.
     BadCss,
 
-    // FIXME: only used in load_image()
-    EmptyData,
-
     /// There is no `<svg>` root element in the XML.
     NoSvgRoot,
 
@@ -376,7 +373,6 @@ impl fmt::Display for LoadingError {
             LoadingError::BadDataUrl => write!(f, "invalid data: URL"),
             LoadingError::BadStylesheet => write!(f, "invalid stylesheet"),
             LoadingError::BadCss => write!(f, "invalid CSS"),
-            LoadingError::EmptyData => write!(f, "empty data"),
             LoadingError::NoSvgRoot => write!(f, "XML does not have <svg> root"),
             LoadingError::Glib(ref e) => e.fmt(f),
             LoadingError::LimitExceeded(ref s) => write!(f, "limit exceeded: {}", s),


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