@@ -197,13 +197,11 @@ where
197
197
}
198
198
199
199
/// CSS font keywords
200
- #[ derive( Animate , ComputeSquaredDistance , MallocSizeOf , ToAnimatedValue , ToAnimatedZero ) ]
201
- #[ derive( Clone , Copy , Debug , PartialEq ) ]
200
+ #[ derive( Animate , Clone , ComputeSquaredDistance , Copy , Debug , MallocSizeOf ) ]
201
+ #[ derive( PartialEq , ToAnimatedValue , ToAnimatedZero ) ]
202
202
#[ allow( missing_docs) ]
203
203
pub enum KeywordSize {
204
- XXSmall = 1 , // This is to enable the NonZero optimization
205
- // which simplifies the representation of Option<KeywordSize>
206
- // in bindgen
204
+ XXSmall ,
207
205
XSmall ,
208
206
Small ,
209
207
Medium ,
@@ -217,17 +215,9 @@ pub enum KeywordSize {
217
215
218
216
impl KeywordSize {
219
217
/// Convert to an HTML <font size> value
220
- pub fn html_size ( & self ) -> u8 {
221
- match * self {
222
- KeywordSize :: XXSmall => 0 ,
223
- KeywordSize :: XSmall => 1 ,
224
- KeywordSize :: Small => 2 ,
225
- KeywordSize :: Medium => 3 ,
226
- KeywordSize :: Large => 4 ,
227
- KeywordSize :: XLarge => 5 ,
228
- KeywordSize :: XXLarge => 6 ,
229
- KeywordSize :: XXXLarge => 7 ,
230
- }
218
+ #[ inline]
219
+ pub fn html_size ( self ) -> u8 {
220
+ self as u8
231
221
}
232
222
}
233
223
0 commit comments