提交 da3061d1 编写于 作者: D Daniel Lockyer

Replace use of .iter() with reference

上级 3bce55f5
......@@ -69,7 +69,7 @@ impl<'w, W: Write + 'w> Exa<'w, W> {
self.args.push(".".to_owned());
}
for file_name in self.args.iter() {
for file_name in &self.args {
match File::from_path(Path::new(&file_name), None) {
Err(e) => {
writeln!(stderr(), "{}: {}", file_name, e)?;
......
......@@ -481,7 +481,7 @@ impl<'a, U: Users+Groups+'a> Table<'a, U> {
/// Use the list of columns to find which cells should be produced for
/// this file, per-column.
pub fn cells_for_file(&self, file: &File, xattrs: bool) -> Vec<TextCell> {
self.columns.clone().iter()
self.columns.iter()
.map(|c| self.display(file, c, xattrs))
.collect()
}
......
......@@ -122,7 +122,7 @@ impl GridDetails {
if self.grid.across {
for row in 0 .. height {
for column in columns.iter() {
for column in &columns {
if row < column.len() {
let cell = grid::Cell {
contents: ANSIStrings(&column[row].contents).to_string(),
......@@ -135,7 +135,7 @@ impl GridDetails {
}
}
else {
for column in columns.iter() {
for column in &columns {
for cell in column.iter() {
let cell = grid::Cell {
contents: ANSIStrings(&cell.contents).to_string(),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册