diff options
author | Florian Gilcher <florian.gilcher@asquera.de> | 2015-11-04 09:41:49 +0100 |
---|---|---|
committer | Florian Gilcher <florian.gilcher@asquera.de> | 2015-11-04 09:41:49 +0100 |
commit | 679b9e18b2c64377455b3fe0a32205a4eac750b7 (patch) | |
tree | 64724d258ebe13e74a98b620c5b5a7131b9368cc | |
parent | 63bd929eb5bf08ca9c9b57fd1d886839536332a4 (diff) |
Replace `sum` call by stable `fold(0, Add::add)`
-rw-r--r-- | src/main.rs | 1 | ||||
-rw-r--r-- | src/output/details.rs | 3 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index a75adf2..618d8f4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,3 @@ -#![feature(iter_arith)] #![feature(convert, fs_mode)] #![warn(trivial_casts, trivial_numeric_casts)] diff --git a/src/output/details.rs b/src/output/details.rs index e3650d5..4eb0580 100644 --- a/src/output/details.rs +++ b/src/output/details.rs @@ -115,6 +115,7 @@ use std::error::Error; use std::io; use std::path::PathBuf; use std::string::ToString; +use std::ops::Add; use colours::Colours; use column::{Alignment, Column, Cell}; @@ -656,7 +657,7 @@ impl<U> Table<U> where U: Users { .map(|n| self.rows.iter().map(|row| row.column_width(n)).max().unwrap_or(0)) .collect(); - let total_width: usize = self.columns.len() + column_widths.iter().sum::<usize>(); + let total_width: usize = self.columns.len() + column_widths.iter().fold(0,Add::add); for row in self.rows.iter() { let mut cell = Cell::empty(); |