@@ -3,14 +3,19 @@ pub const CONVERT_STYLE_PX_FN: &'static str = "convertNumber2VP";
3
3
pub const ENV_FUN : & ' static str = "__env__" ;
4
4
5
5
// 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
+ ] ;
8
14
9
15
pub const RN_CONVERT_STYLE_PX_FN : & ' static str = "scalePx2dp" ;
10
16
pub const RN_CONVERT_STYLE_VU_FN : & ' static str = "scaleVu2dp" ;
11
17
12
-
13
- #[ repr( u32 ) ]
18
+ #[ repr( u32 ) ]
14
19
#[ derive( Hash , PartialEq , Eq , Debug , Clone ) ]
15
20
pub enum Pseudo {
16
21
None ,
@@ -26,19 +31,18 @@ impl Pseudo {
26
31
// 将 SelectorType 枚举值转换为 f64
27
32
pub fn to_f64 ( self ) -> f64 {
28
33
( 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 ,
36
41
} ) as f64
37
42
}
38
43
}
39
44
40
-
41
- #[ repr( u32 ) ]
45
+ #[ repr( u32 ) ]
42
46
#[ derive( Hash , PartialEq , Eq , Debug , Clone , Copy ) ]
43
47
pub enum SelectorType {
44
48
Subject ,
@@ -50,6 +54,6 @@ pub enum SelectorType {
50
54
impl SelectorType {
51
55
// 将 SelectorType 枚举值转换为 f64
52
56
pub fn to_f64 ( self ) -> f64 {
53
- self as u32 as f64
57
+ self as u32 as f64
54
58
}
55
59
}
0 commit comments