[librsvg/librsvg-2.44] error::LoadingError: new error enum for the loading stage
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/librsvg-2.44] error::LoadingError: new error enum for the loading stage
- Date: Tue, 9 Oct 2018 14:17:53 +0000 (UTC)
commit 3c1ca12f42c5f82869da7d43b02fdf794b0996dd
Author: Federico Mena Quintero <federico gnome org>
Date: Mon Oct 1 11:14:21 2018 -0500
error::LoadingError: new error enum for the loading stage
rsvg_internals/src/error.rs | 14 ++++++++++++++
1 file changed, 14 insertions(+)
---
diff --git a/rsvg_internals/src/error.rs b/rsvg_internals/src/error.rs
index 0e3df141..db5a824e 100644
--- a/rsvg_internals/src/error.rs
+++ b/rsvg_internals/src/error.rs
@@ -100,6 +100,20 @@ impl From<cairo::Status> for RenderingError {
}
}
+#[derive(Clone)]
+pub enum LoadingError {
+ Cairo(cairo::Status),
+ EmptyData,
+}
+
+impl From<cairo::Status> for LoadingError {
+ fn from(e: cairo::Status) -> LoadingError {
+ assert!(e != cairo::Status::Success);
+
+ LoadingError::Cairo(e)
+ }
+}
+
#[cfg(test)]
pub fn is_parse_error<T>(r: &Result<T, ValueErrorKind>) -> bool {
match *r {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]