mirror of
https://github.com/Llewellynvdm/exa.git
synced 2024-11-22 20:15:11 +00:00
Replace sum
call by stable fold(0, Add::add)
This commit is contained in:
parent
63bd929eb5
commit
679b9e18b2
@ -1,4 +1,3 @@
|
||||
#![feature(iter_arith)]
|
||||
#![feature(convert, fs_mode)]
|
||||
|
||||
#![warn(trivial_casts, trivial_numeric_casts)]
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user