[librsvg: 1/5] state: do not manually implement Default for ComputedValues
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 1/5] state: do not manually implement Default for ComputedValues
- Date: Wed, 12 Sep 2018 11:55:48 +0000 (UTC)
commit 4c8a46c9b29452fbea80182cd893998fa3c3562e
Author: Paolo Borelli <pborelli gnome org>
Date: Sun Sep 9 21:11:30 2018 +0200
state: do not manually implement Default for ComputedValues
rsvg_internals/src/state.rs | 58 +--------------------------------------------
1 file changed, 1 insertion(+), 57 deletions(-)
---
diff --git a/rsvg_internals/src/state.rs b/rsvg_internals/src/state.rs
index 8dfe8e0e..aa574218 100644
--- a/rsvg_internals/src/state.rs
+++ b/rsvg_internals/src/state.rs
@@ -144,7 +144,7 @@ pub struct SpecifiedValues {
pub xml_space: SpecifiedValue<XmlSpace>, // not a property, but a non-presentation attribute
}
-#[derive(Debug, Clone)]
+#[derive(Debug, Default, Clone)]
pub struct ComputedValues {
pub baseline_shift: BaselineShift,
pub clip_path: ClipPath,
@@ -220,62 +220,6 @@ impl ComputedValues {
}
}
-impl Default for ComputedValues {
- fn default() -> ComputedValues {
- ComputedValues {
- // please keep these sorted
- baseline_shift: Default::default(),
- clip_path: Default::default(),
- clip_rule: Default::default(),
- color: Default::default(),
- color_interpolation_filters: Default::default(),
- comp_op: Default::default(),
- direction: Default::default(),
- display: Default::default(),
- enable_background: Default::default(),
- fill: Default::default(),
- fill_opacity: Default::default(),
- fill_rule: Default::default(),
- filter: Default::default(),
- flood_color: Default::default(),
- flood_opacity: Default::default(),
- font_family: Default::default(),
- font_size: Default::default(),
- font_stretch: Default::default(),
- font_style: Default::default(),
- font_variant: Default::default(),
- font_weight: Default::default(),
- letter_spacing: Default::default(),
- lighting_color: Default::default(),
- marker_end: Default::default(),
- marker_mid: Default::default(),
- marker_start: Default::default(),
- mask: Default::default(),
- opacity: Default::default(),
- overflow: Default::default(),
- shape_rendering: Default::default(),
- stop_color: Default::default(),
- stop_opacity: Default::default(),
- stroke: Default::default(),
- stroke_dasharray: Default::default(),
- stroke_dashoffset: Default::default(),
- stroke_line_cap: Default::default(),
- stroke_line_join: Default::default(),
- stroke_opacity: Default::default(),
- stroke_miterlimit: Default::default(),
- stroke_width: Default::default(),
- text_anchor: Default::default(),
- text_decoration: Default::default(),
- text_rendering: Default::default(),
- unicode_bidi: Default::default(),
- visibility: Default::default(),
- writing_mode: Default::default(),
- xml_lang: Default::default(),
- xml_space: Default::default(),
- }
- }
-}
-
macro_rules! compute_value {
($self:ident, $computed:ident, $name:ident) => {
$computed.$name = $self.$name.compute(&$computed.$name, &$computed)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]