[librsvg: 6/51] morphology.rs: Don't create a NodeError directly
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 6/51] morphology.rs: Don't create a NodeError directly
- Date: Thu, 19 Dec 2019 01:48:31 +0000 (UTC)
commit 0384845fcf27f081cde38bb7e5a2d2d080fb3e97
Author: Federico Mena Quintero <federico gnome org>
Date: Mon Dec 16 20:17:02 2019 -0600
morphology.rs: Don't create a NodeError directly
rsvg_internals/src/filters/morphology.rs | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/rsvg_internals/src/filters/morphology.rs b/rsvg_internals/src/filters/morphology.rs
index 5bfbb593..7b4d4447 100644
--- a/rsvg_internals/src/filters/morphology.rs
+++ b/rsvg_internals/src/filters/morphology.rs
@@ -4,7 +4,7 @@ use cairo::{self, ImageSurface};
use markup5ever::{expanded_name, local_name, namespace_url, ns, QualName};
use crate::drawing_ctx::DrawingCtx;
-use crate::error::{AttributeResultExt, NodeError};
+use crate::error::*;
use crate::node::{NodeResult, NodeTrait, RsvgNode};
use crate::parsers;
use crate::property_bag::PropertyBag;
@@ -57,14 +57,13 @@ impl NodeTrait for FeMorphology {
expanded_name!(svg "operator") => self.operator = Operator::parse(attr, value)?,
expanded_name!(svg "radius") => {
self.radius = parsers::number_optional_number(value)
- .attribute(attr.clone())
.and_then(|(x, y)| {
if x >= 0.0 && y >= 0.0 {
Ok((x, y))
} else {
- Err(NodeError::value_error(attr, "radius cannot be negative"))
+ Err(ValueErrorKind::value_error("radius cannot be negative"))
}
- })?
+ }).attribute(attr)?
}
_ => (),
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]