pub fn cost(&self) -> i32 {
        self.flows.iter()
            .map(|flow| flow.amount as i32 * flow.cost)
            .sum()
    }
/// Returns the total cost of the path.
/// `path.cost()` is always a multiple of `path.amount()`.
Returns the total cost of the path.
Returns the total cost of the path .
pub fn cost(&self) -> i32 {
        self.flows.iter()
            .map(|flow| flow.amount as i32 * flow.cost)
            .sum()
    }
pub fn cost ( & self ) -> i32 { self . flows . iter ( ) . map ( | flow | flow . amount as i32 * flow . cost ) . sum ( ) }
Returns the total cost of the path.
Returns the total cost of the path .
&self
&self