Skip to content

Commit

Permalink
simplify match
Browse files Browse the repository at this point in the history
  • Loading branch information
nhedger committed Feb 10, 2024
1 parent 9d5aca7 commit 878d4de
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions crates/biome_service/src/file_handlers/vue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,13 @@ fn parse(
_ => "",
};

let language = match matches {
Some(captures) => match captures.name("lang") {
Some(lang) => match lang.as_str() {
"ts" => JsFileSource::ts(),
_ => JsFileSource::js_module(),
},
let language = matches
.and_then(|captures| captures.name("lang"))
.map(|lang| match lang.as_str() {
"ts" => JsFileSource::ts(),
_ => JsFileSource::js_module(),
},
_ => JsFileSource::js_module(),
};
})
.unwrap_or(JsFileSource::js_module());

debug!("Parsing file with language {:?}", language);

Expand Down

0 comments on commit 878d4de

Please sign in to comment.