Skip to content

Commit

Permalink
match -> .map()
Browse files Browse the repository at this point in the history
  • Loading branch information
hanneslund committed Dec 21, 2021
1 parent 93afebd commit cee2c1b
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions packages/next-swc/crates/core/src/page_config.rs
Expand Up @@ -82,16 +82,13 @@ impl Fold for PageConfig {
}

if is_config {
let init = match &decl.init {
Some(expr) => {
Some(if let Expr::TsAs(obj) = &**expr {
&obj.expr
} else {
expr
})
let init = decl.init.as_ref().map(|expr| {
if let Expr::TsAs(ts_as) = &**expr {
&ts_as.expr
} else {
expr
}
None => None
};
});

if let Some(expr) = init {
if let Expr::Object(obj) = &**expr {
Expand Down

0 comments on commit cee2c1b

Please sign in to comment.