Skip to content

Commit f29e6f6

Browse files
committed
Fix ignore
1 parent ffd301a commit f29e6f6

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ tsconfig.tsbuildinfo
1212
codecov
1313
codecov.*
1414
codecov.*.*
15+
lcov.info
16+
tarpaulin-report.html

libs/extractor/src/visit.rs

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -94,39 +94,37 @@ impl<'a> VisitMut<'a> for DevupVisitor<'a> {
9494
None,
9595
));
9696
} else if call.arguments.len() == 1 {
97-
match extract_style_from_expression(
97+
if let ExtractResult::ExtractStyle(styles) = extract_style_from_expression(
9898
&self.ast,
9999
None,
100100
call.arguments[0].to_expression_mut(),
101101
0,
102102
None,
103103
) {
104-
ExtractResult::ExtractStyle(styles)
105-
| ExtractResult::ExtractStyleWithChangeTag(styles, _) => {
106-
let class_name = gen_class_names(&self.ast, &styles);
107-
let mut styles = styles
108-
.into_iter()
109-
.flat_map(|ex| ex.extract())
110-
.collect::<Vec<_>>();
104+
// css can not reachable
105+
// ExtractResult::ExtractStyleWithChangeTag(styles, _)
106+
let class_name = gen_class_names(&self.ast, &styles);
107+
let mut styles = styles
108+
.into_iter()
109+
.flat_map(|ex| ex.extract())
110+
.collect::<Vec<_>>();
111111

112-
self.styles.append(&mut styles);
113-
if let Some(cls) = class_name {
114-
*it = cls;
115-
} else {
116-
*it = Expression::StringLiteral(self.ast.alloc_string_literal(
117-
SPAN,
118-
"".to_string(),
119-
None,
120-
));
121-
}
122-
}
123-
_ => {
112+
self.styles.append(&mut styles);
113+
if let Some(cls) = class_name {
114+
*it = cls;
115+
} else {
124116
*it = Expression::StringLiteral(self.ast.alloc_string_literal(
125117
SPAN,
126118
"".to_string(),
127119
None,
128120
));
129121
}
122+
} else {
123+
*it = Expression::StringLiteral(self.ast.alloc_string_literal(
124+
SPAN,
125+
"".to_string(),
126+
None,
127+
));
130128
}
131129
}
132130
}

0 commit comments

Comments
 (0)