[librsvg: 14/32] Make LoadingError and RenderingError non_exhaustive




commit 570e23f172aa77cd311bec0cb7fac722ed64a977
Author: Federico Mena Quintero <federico gnome org>
Date:   Thu Nov 26 11:49:17 2020 -0600

    Make LoadingError and RenderingError non_exhaustive
    
    This should allow us to add new enum variants in the future without
    breaking code.

 src/error.rs | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/src/error.rs b/src/error.rs
index 3805eed3..4a8a6da2 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -117,6 +117,7 @@ pub enum DefsLookupErrorKind {
 }
 
 /// Errors that can happen while rendering or measuring an SVG document.
+#[non_exhaustive]
 #[derive(Debug, Clone, PartialEq)]
 pub enum RenderingError {
     /// A Cairo error happened during rendering.
@@ -307,6 +308,7 @@ impl From<HrefError> for ValueErrorKind {
 ///
 /// I/O errors get reported in the `Glib` variant, since librsvg uses GIO internally for
 /// all input/output.
+#[non_exhaustive]
 #[derive(Debug, Clone)]
 pub enum LoadingError {
     /// XML syntax error.


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