Skip to content

Commit

Permalink
fix(turbopack-css): update swc_core changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kwonoj committed Dec 14, 2022
1 parent 9c0c8e8 commit 6ad3a8d
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions crates/turbopack-css/src/references/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl ImportAttributes {
assert_eq!(f.value.len(), 1);
assert!(matches!(&f.value[0], ComponentValue::LayerName(_)));
if let ComponentValue::LayerName(layer_name) = &f.value[0] {
layer_name.clone()
*layer_name.clone()
} else {
unreachable!()
}
Expand All @@ -68,12 +68,12 @@ impl ImportAttributes {

if let Some(supports) = v {
match &supports {
ComponentValue::SupportsCondition(s) => Some(s.clone()),
ComponentValue::SupportsCondition(s) => Some(*s.clone()),
ComponentValue::Declaration(d) => Some(SupportsCondition {
span: DUMMY_SP,
conditions: vec![SupportsConditionType::SupportsInParens(
SupportsInParens::Feature(SupportsFeature::Declaration(
Box::new(d.clone()),
d.clone(),
)),
)],
}),
Expand Down Expand Up @@ -110,10 +110,12 @@ impl ImportAttributes {
// something random that's never gonna be in real css
let mut rule = Rule::ListOfComponentValues(box ListOfComponentValues {
span: DUMMY_SP,
children: vec![ComponentValue::PreservedToken(token(Token::String {
value: Default::default(),
raw: r#""""__turbopack_placeholder__""""#.into(),
}))],
children: vec![ComponentValue::PreservedToken(Box::new(token(
Token::String {
value: Default::default(),
raw: r#""""__turbopack_placeholder__""""#.into(),
},
)))],
});

fn at_rule(name: &str, prelude: AtRulePrelude, inner_rule: Rule) -> Rule {
Expand All @@ -128,7 +130,7 @@ impl ImportAttributes {
block: Some(SimpleBlock {
span: DUMMY_SP,
name: token(Token::LBrace),
value: vec![ComponentValue::Rule(inner_rule)],
value: vec![ComponentValue::from(inner_rule)],
}),
})
}
Expand Down

0 comments on commit 6ad3a8d

Please sign in to comment.