Skip to content

Commit

Permalink
style: Simplify filter condition in format_env_file
Browse files Browse the repository at this point in the history
  • Loading branch information
schpet committed Sep 24, 2024
1 parent 71a757f commit ed7cd6f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,9 @@ pub fn format_env_file(content: &str, prune: bool) -> Result<Vec<parser::Line>,

let mut key_value_lines: Vec<parser::Line> = lines
.into_iter()
.filter(|line| {
match line {
parser::Line::KeyValue { value, .. } => !value.is_empty(),
parser::Line::Comment(_) => !prune,
}
.filter(|line| match line {
parser::Line::KeyValue { value, .. } => !value.is_empty(),
parser::Line::Comment(_) => !prune,
})
.collect();

Expand Down

0 comments on commit ed7cd6f

Please sign in to comment.