@@ -21,9 +21,10 @@ pub enum PropertyMeta {
2121 ///
2222 /// It is designed for debugging only.
2323 /// In production environment, properties are well-normalized -
24- /// shorthand properties (e.g. `font` `background`) are splitted in advance.
24+ /// shorthand properties (e.g. `font` `background`) are split in advance.
2525 /// However, we may add new shorthand properties in debugger -
2626 /// we can keep the shorthand properties as-is with `DebugGroup`s.
27+ #[ cfg( feature = "debug" ) ]
2728 DebugGroup {
2829 /// The original name-value string pair.
2930 original_name_value : Box < ( String , String ) > ,
@@ -51,6 +52,7 @@ impl PropertyMeta {
5152 /// Note that the new property is in *debug* mode so that:
5253 /// * it cannot be serialized even if it has been inserted to a rule;
5354 /// * it has a little performance penalty.
55+ #[ cfg( feature = "debug" ) ]
5456 pub fn to_debug_state ( & self , disabled : bool ) -> Self {
5557 match self {
5658 Self :: Normal { property } => Self :: DebugGroup {
@@ -90,6 +92,7 @@ impl PropertyMeta {
9092 match self {
9193 Self :: Normal { .. } => false ,
9294 Self :: Important { .. } => true ,
95+ #[ cfg( feature = "debug" ) ]
9396 Self :: DebugGroup { important, .. } => * important,
9497 }
9598 }
@@ -99,6 +102,7 @@ impl PropertyMeta {
99102 match self {
100103 Self :: Normal { property } => property. get_property_name ( ) . into ( ) ,
101104 Self :: Important { property } => property. get_property_name ( ) . into ( ) ,
105+ #[ cfg( feature = "debug" ) ]
102106 Self :: DebugGroup {
103107 original_name_value,
104108 ..
@@ -117,6 +121,7 @@ impl PropertyMeta {
117121 v. push_str ( " !important" ) ;
118122 v
119123 }
124+ #[ cfg( feature = "debug" ) ]
120125 Self :: DebugGroup {
121126 original_name_value,
122127 ..
@@ -129,6 +134,7 @@ impl PropertyMeta {
129134 match self {
130135 Self :: Normal { .. } => false ,
131136 Self :: Important { .. } => false ,
137+ #[ cfg( feature = "debug" ) ]
132138 Self :: DebugGroup { disabled, .. } => * disabled,
133139 }
134140 }
@@ -138,6 +144,7 @@ impl PropertyMeta {
138144 match self {
139145 Self :: Normal { .. } => false ,
140146 Self :: Important { .. } => false ,
147+ #[ cfg( feature = "debug" ) ]
141148 Self :: DebugGroup { properties, .. } => properties. len ( ) == 0 ,
142149 }
143150 }
@@ -148,6 +155,7 @@ impl PropertyMeta {
148155 Self :: Normal { property, .. } | Self :: Important { property, .. } => {
149156 property. is_deprecated ( )
150157 }
158+ #[ cfg( feature = "debug" ) ]
151159 Self :: DebugGroup { .. } => false ,
152160 }
153161 }
@@ -166,6 +174,7 @@ impl PropertyMeta {
166174 PropertyMeta :: Important { property : p } => {
167175 node_properties. merge_property ( p, parent_node_properties, current_font_size)
168176 }
177+ #[ cfg( feature = "debug" ) ]
169178 PropertyMeta :: DebugGroup {
170179 properties,
171180 disabled,
@@ -189,6 +198,7 @@ impl PropertyMeta {
189198 pub fn property ( & self ) -> Option < Property > {
190199 match self {
191200 Self :: Normal { property } | Self :: Important { property } => Some ( property. clone ( ) ) ,
201+ #[ cfg( feature = "debug" ) ]
192202 Self :: DebugGroup { .. } => None ,
193203 }
194204 }
@@ -233,6 +243,7 @@ impl<'a> Iterator for PropertyMetaIter<'a> {
233243 None
234244 }
235245 }
246+ #[ cfg( feature = "debug" ) ]
236247 PropertyMeta :: DebugGroup { properties, .. } => {
237248 if self . cur < properties. len ( ) {
238249 let ret = & properties[ self . cur ] ;
@@ -317,6 +328,7 @@ impl Rule {
317328 _ => { }
318329 }
319330 }
331+ #[ cfg( feature = "debug" ) ]
320332 PropertyMeta :: DebugGroup { properties, .. } => {
321333 for property in properties. iter ( ) {
322334 match property {
@@ -377,6 +389,7 @@ impl Rule {
377389 }
378390
379391 /// Enable or disable the rule (and construct a new one as the result if success)
392+ #[ cfg( feature = "debug" ) ]
380393 pub fn set_property_disabled ( & self , index : usize , disabled : bool ) -> Option < Box < Self > > {
381394 let media = self . media . clone ( ) ;
382395 let selector = self . selector . clone ( ) ;
0 commit comments