summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@gnome.org>2022-10-24 16:22:37 -0500
committerFederico Mena Quintero <federico@gnome.org>2022-11-04 09:33:33 -0600
commita4b73b817719cdb18382f1ce8b699772636ab771 (patch)
tree2d9bb3d0d4d0a71fc11aea1e2a92d60c48041254
parenta14e4cf78bd38c5ef692539088a4d558619fde00 (diff)
downloadlibrsvg-a4b73b817719cdb18382f1ce8b699772636ab771.tar.gz
Element creation does not generate errors anymore
This removes ElementInner::set_error(). Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/763>
-rw-r--r--src/element.rs23
1 files changed, 3 insertions, 20 deletions
diff --git a/src/element.rs b/src/element.rs
index f868dc59..eaa1eddb 100644
--- a/src/element.rs
+++ b/src/element.rs
@@ -129,15 +129,8 @@ impl<T: SetAttributes + Draw> ElementInner<T> {
element_impl,
};
- let mut set_attributes = || -> Result<(), ElementError> {
- e.set_conditional_processing_attributes(session)?;
- e.set_presentation_attributes(session);
- Ok(())
- };
-
- if let Err(error) = set_attributes() {
- e.set_error(error, session);
- }
+ e.set_conditional_processing_attributes(session);
+ e.set_presentation_attributes(session);
e
}
@@ -192,10 +185,7 @@ impl<T: SetAttributes + Draw> ElementInner<T> {
.unwrap_or(true)
}
- fn set_conditional_processing_attributes(
- &mut self,
- session: &Session,
- ) -> Result<(), ElementError> {
+ fn set_conditional_processing_attributes(&mut self, session: &Session) {
for (attr, value) in self.attributes.iter() {
match attr.expanded() {
expanded_name!("", "requiredExtensions") => {
@@ -213,8 +203,6 @@ impl<T: SetAttributes + Draw> ElementInner<T> {
_ => {}
}
}
-
- Ok(())
}
/// Hands the `attrs` to the node's state, to apply the presentation attributes.
@@ -250,11 +238,6 @@ impl<T: SetAttributes + Draw> ElementInner<T> {
}
}
- fn set_error(&mut self, error: ElementError, session: &Session) {
- rsvg_log!(session, "setting node {} in error: {}", self, error);
- self.is_in_error = true;
- }
-
fn is_in_error(&self) -> bool {
self.is_in_error
}