[librsvg: 4/51] turbulence.rs: Don't create a NodeError directly
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 4/51] turbulence.rs: Don't create a NodeError directly
- Date: Thu, 19 Dec 2019 01:48:21 +0000 (UTC)
commit f32996d89fda65dac68ed9dd0fe6d1180ed41894
Author: Federico Mena Quintero <federico gnome org>
Date: Mon Dec 16 20:10:56 2019 -0600
turbulence.rs: Don't create a NodeError directly
rsvg_internals/src/filters/turbulence.rs | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/rsvg_internals/src/filters/turbulence.rs b/rsvg_internals/src/filters/turbulence.rs
index 1320ac47..6bf37775 100644
--- a/rsvg_internals/src/filters/turbulence.rs
+++ b/rsvg_internals/src/filters/turbulence.rs
@@ -2,7 +2,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::{CascadedValues, NodeResult, NodeTrait, RsvgNode};
use crate::parsers;
use crate::property_bag::PropertyBag;
@@ -66,14 +66,13 @@ impl NodeTrait for FeTurbulence {
match attr.expanded() {
expanded_name!(svg "baseFrequency") => {
self.base_frequency = 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, "values can't be negative"))
+ Err(ValueErrorKind::value_error("values can't be negative"))
}
- })?
+ }).attribute(attr)?
}
expanded_name!(svg "numOctaves") => {
self.num_octaves = parsers::integer(value).attribute(attr)?
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]