Skip to content

Commit c9bed43

Browse files
committed
chore: 格式化代码
1 parent f3604d6 commit c9bed43

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+4367
-3406
lines changed

src/constants.rs

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,19 @@ pub const CONVERT_STYLE_PX_FN: &'static str = "convertNumber2VP";
33
pub 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

915
pub const RN_CONVERT_STYLE_PX_FN: &'static str = "scalePx2dp";
1016
pub const RN_CONVERT_STYLE_VU_FN: &'static str = "scaleVu2dp";
1117

12-
13-
#[repr(u32)]
18+
#[repr(u32)]
1419
#[derive(Hash, PartialEq, Eq, Debug, Clone)]
1520
pub 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)]
4347
pub enum SelectorType {
4448
Subject,
@@ -50,6 +54,6 @@ pub enum SelectorType {
5054
impl 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

Comments
 (0)