diff options
author | Ben S <ogham@bsago.me> | 2015-08-25 18:29:23 +0100 |
---|---|---|
committer | Ben S <ogham@bsago.me> | 2015-08-25 18:29:23 +0100 |
commit | a250f21282b54d7ce7856057539ff667411d43f7 (patch) | |
tree | bda3418312ffef2a09f724041571cdf46fb112af /src/output | |
parent | e523520b5653f65acf5e0c5266eaa34f6b3cea8f (diff) |
Coalesce platform-specific xattr modules
Now we have one Ur-module that contains functionality common to both supported platforms.
The benefits of doing it this way are that:
1. It doesn't implement a dummy interface - rather, there will be less code generated when the feature is not present;
2. The code shared between them can be kept in sync. The other two modules were something like 80% the same.
Diffstat (limited to 'src/output')
-rw-r--r-- | src/output/details.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/output/details.rs b/src/output/details.rs index 8f35b8e..acc3f7d 100644 --- a/src/output/details.rs +++ b/src/output/details.rs @@ -7,7 +7,7 @@ use std::string::ToString; use colours::Colours; use column::{Alignment, Column, Cell}; use dir::Dir; -use feature::Attribute; +use feature::xattr::Attribute; use file::fields as f; use file::File; use options::{Columns, FileFilter, RecurseOptions, SizeFormat}; @@ -508,11 +508,11 @@ impl<U> Table<U> where U: Users { filename_length += row.name.length; if xattr { - let width = row.attrs.iter().map(|a| a.name().len()).max().unwrap_or(0); + let width = row.attrs.iter().map(|a| a.name.len()).max().unwrap_or(0); for attr in row.attrs.iter() { - let name = attr.name(); + let name = &*attr.name; let spaces: String = repeat(" ").take(width - name.len()).collect(); - filename.push_str(&*format!("\n{}{} {}", name, spaces, attr.size())) + filename.push_str(&*format!("\n{}{} {}", name, spaces, attr.size)) } } |