Skip to content

Commit

Permalink
Inline one step
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-mausch committed Jul 3, 2023
1 parent f119847 commit 1f6b41a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ pub fn process(files: Vec<String>, format: Format, output_stream: &mut dyn Write
process_file(path, reader)
})
}).collect();
let y: Result<Vec<Vec<Transaction>>, Box<dyn Error>> = transactions.into_iter().collect();
let z: Result<Vec<Transaction>, Box<dyn Error>> = y.map(|value| value.into_iter().flatten().collect());
let z: Result<Vec<Transaction>, Box<dyn Error>> = transactions.into_iter().collect::<Result<Vec<Vec<_>>, _>>()
.map(|value| value.into_iter().flatten().collect());

let write = match format {
Format::Csv => Csv::write,
Expand Down

0 comments on commit 1f6b41a

Please sign in to comment.