[librsvg: 12/51] node.rs: Don't create a NodeError directly
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 12/51] node.rs: Don't create a NodeError directly
- Date: Thu, 19 Dec 2019 01:49:01 +0000 (UTC)
commit 81e38af0f65cefdcd6303a2ea60f1c2787ebc26b
Author: Federico Mena Quintero <federico gnome org>
Date: Tue Dec 17 10:47:26 2019 -0600
node.rs: Don't create a NodeError directly
rsvg_internals/src/node.rs | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/rsvg_internals/src/node.rs b/rsvg_internals/src/node.rs
index 2c12772d..b3dd0130 100644
--- a/rsvg_internals/src/node.rs
+++ b/rsvg_internals/src/node.rs
@@ -175,8 +175,7 @@ impl NodeData {
let mut cond = self.cond;
for (attr, value) in pbag.iter() {
- // FIXME: move this to "try {}" when we can bump the rustc version dependency
- let mut parse = || {
+ let mut parse = || -> Result<_, ValueErrorKind> {
match attr.expanded() {
expanded_name!(svg "requiredExtensions") if cond => {
cond = RequiredExtensions::from_attribute(value)
@@ -199,9 +198,7 @@ impl NodeData {
Ok(cond)
};
- parse()
- .map(|c| self.cond = c)
- .map_err(|e| NodeError::new(attr, e))?;
+ parse().map(|c| self.cond = c).attribute(attr)?;
}
Ok(())
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]