mirror of
https://github.com/Llewellynvdm/exa.git
synced 2024-06-02 07:20:48 +00:00
Replace use of .iter() with reference
This commit is contained in:
parent
3bce55f569
commit
da3061d1b3
|
@ -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(),
|
||||
|
|
Loading…
Reference in New Issue
Block a user