eval
Log in

Iterator Pipeline

10 points

Implement total_revenue, which sums the amount of every non-refunded order. Write it as a single lazy chain rather than a manual for loop with an accumulator variable.

Required signature

pub struct Order {     pub amount: f64,     pub refunded: bool, }  pub fn total_revenue(orders: &[Order]) -> f64;

Visible tests

Your solution

Log in to submit a solution.