@@ -3,14 +3,19 @@ pub const CONVERT_STYLE_PX_FN: &'static str = "convertNumber2VP";
33pub const ENV_FUN : & ' static str = "__env__" ;
44
55// pub const CALC_DYMAMIC_STYLE: &'static str = "calcDynamicStyle";
6- pub static SUPPORT_PSEUDO_KEYS : [ & ' static str ; 6 ] = [ ":before" , ":after" , ":first-child" , ":last-child" , ":nth-child" , ":empty" ] ;
7-
6+ pub static SUPPORT_PSEUDO_KEYS : [ & ' static str ; 6 ] = [
7+ ":before" ,
8+ ":after" ,
9+ ":first-child" ,
10+ ":last-child" ,
11+ ":nth-child" ,
12+ ":empty" ,
13+ ] ;
814
915pub const RN_CONVERT_STYLE_PX_FN : & ' static str = "scalePx2dp" ;
1016pub const RN_CONVERT_STYLE_VU_FN : & ' static str = "scaleVu2dp" ;
1117
12-
13- #[ repr( u32 ) ]
18+ #[ repr( u32 ) ]
1419#[ derive( Hash , PartialEq , Eq , Debug , Clone ) ]
1520pub enum Pseudo {
1621 None ,
@@ -26,19 +31,18 @@ impl Pseudo {
2631 // 将 SelectorType 枚举值转换为 f64
2732 pub fn to_f64 ( self ) -> f64 {
2833 ( match & self {
29- Pseudo :: None => 0 ,
30- Pseudo :: Before => 1 ,
31- Pseudo :: After => 2 ,
32- Pseudo :: FirstChild => 3 ,
33- Pseudo :: LastChild => 4 ,
34- Pseudo :: NthChild ( _) => 5 ,
35- Pseudo :: Empty => 6 ,
34+ Pseudo :: None => 0 ,
35+ Pseudo :: Before => 1 ,
36+ Pseudo :: After => 2 ,
37+ Pseudo :: FirstChild => 3 ,
38+ Pseudo :: LastChild => 4 ,
39+ Pseudo :: NthChild ( _) => 5 ,
40+ Pseudo :: Empty => 6 ,
3641 } ) as f64
3742 }
3843}
3944
40-
41- #[ repr( u32 ) ]
45+ #[ repr( u32 ) ]
4246#[ derive( Hash , PartialEq , Eq , Debug , Clone , Copy ) ]
4347pub enum SelectorType {
4448 Subject ,
@@ -50,6 +54,6 @@ pub enum SelectorType {
5054impl SelectorType {
5155 // 将 SelectorType 枚举值转换为 f64
5256 pub fn to_f64 ( self ) -> f64 {
53- self as u32 as f64
57+ self as u32 as f64
5458 }
5559}
0 commit comments