Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jfrolich committed Apr 12, 2024
1 parent 8a817f2 commit 12774df
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/bsconfig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ pub fn flatten_flags(flags: &Option<Vec<OneOrMore<String>>>) -> Vec<String> {
})
.collect::<Vec<String>>()
.iter()
.flat_map(|str| str.split(" "))
.flat_map(|str| str.split(' '))
.map(|str| str.to_string())
.collect::<Vec<String>>(),
}
Expand All @@ -194,7 +194,7 @@ pub fn flatten_ppx_flags(
None => vec![],
Some(xs) => xs
.iter()
.map(|x| match x {
.flat_map(|x| match x {
OneOrMore::Single(y) => {
let first_character = y.chars().next();
match first_character {
Expand All @@ -207,7 +207,7 @@ pub fn flatten_ppx_flags(
_ => vec!["-ppx".to_string(), node_modules_dir.to_owned() + "/" + y],
}
}
OneOrMore::Multiple(ys) if ys.len() == 0 => vec![],
OneOrMore::Multiple(ys) if ys.is_empty() => vec![],
OneOrMore::Multiple(ys) => {
let first_character = ys[0].chars().next();
let ppx = match first_character {
Expand All @@ -224,7 +224,6 @@ pub fn flatten_ppx_flags(
]
}
})
.flatten()
.collect::<Vec<String>>(),
}
}
Expand Down

0 comments on commit 12774df

Please sign in to comment.