[librsvg: 23/51] Inline NodeError::new() into its only caller
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 23/51] Inline NodeError::new() into its only caller
- Date: Thu, 19 Dec 2019 01:49:57 +0000 (UTC)
commit 5954f6fac7976e99cd5bc929181c3fa776e0b180
Author: Federico Mena Quintero <federico gnome org>
Date: Tue Dec 17 11:06:45 2019 -0600
Inline NodeError::new() into its only caller
This finishes removing all the methods of NodeError.
rsvg_internals/src/error.rs | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
---
diff --git a/rsvg_internals/src/error.rs b/rsvg_internals/src/error.rs
index b407c0ec..497398c2 100644
--- a/rsvg_internals/src/error.rs
+++ b/rsvg_internals/src/error.rs
@@ -61,12 +61,6 @@ pub struct NodeError {
pub err: ValueErrorKind,
}
-impl NodeError {
- pub fn new(attr: QualName, error: ValueErrorKind) -> NodeError {
- NodeError { attr, err: error }
- }
-}
-
impl error::Error for NodeError {
fn description(&self) -> &str {
match self.err {
@@ -178,7 +172,7 @@ pub trait AttributeResultExt<O, E> {
impl<O, E: Into<ValueErrorKind>> AttributeResultExt<O, E> for Result<O, E> {
fn attribute(self, attr: QualName) -> Result<O, NodeError> {
self.map_err(|e| e.into())
- .map_err(|e| NodeError::new(attr, e))
+ .map_err(|err| NodeError { attr, err })
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]