[librsvg] paint_server.rs: Fix errors
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] paint_server.rs: Fix errors
- Date: Tue, 21 Mar 2017 22:58:18 +0000 (UTC)
commit 08cd6c8ba763cb58b486ce80d54d22454d68a17e
Author: Federico Mena Quintero <federico gnome org>
Date: Tue Mar 21 16:54:00 2017 -0600
paint_server.rs: Fix errors
rust/src/paint_server.rs | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/rust/src/paint_server.rs b/rust/src/paint_server.rs
index 8554a87..dfd88d1 100644
--- a/rust/src/paint_server.rs
+++ b/rust/src/paint_server.rs
@@ -1,5 +1,6 @@
use std::str::FromStr;
+use error::*;
use parsers::ParseError;
/// Defines the units to be used for scaling paint servers, per the [svg specification].
@@ -12,13 +13,13 @@ pub enum PaintServerUnits {
}
impl FromStr for PaintServerUnits {
- type Err = ParseError;
+ type Err = AttributeError;
- fn from_str (s: &str) -> Result<PaintServerUnits, ParseError> {
+ fn from_str (s: &str) -> Result<PaintServerUnits, AttributeError> {
match s {
"userSpaceOnUse" => Ok (PaintServerUnits::UserSpaceOnUse),
"objectBoundingBox" => Ok (PaintServerUnits::ObjectBoundingBox),
- _ => Err (ParseError::new ("expected 'userSpaceOnUse' or 'objectBoundingBox'"))
+ _ => Err (AttributeError::Parse (ParseError::new ("expected 'userSpaceOnUse'
or 'objectBoundingBox'")))
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]