diff options
author | Ben S <ogham@bsago.me> | 2015-04-23 13:46:37 +0100 |
---|---|---|
committer | Ben S <ogham@bsago.me> | 2015-04-23 13:46:37 +0100 |
commit | d7d11f77f3a6cbc71e013a3c57eb78d5352b2a5e (patch) | |
tree | 1d6c5f14daf813ba8be96730ac78deec8bbabc87 /src/file.rs | |
parent | adbaa51cb9421df43625b96ea3ea39b455fd5ee4 (diff) |
Use unicode_width crate
Diffstat (limited to 'src/file.rs')
-rw-r--r-- | src/file.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/file.rs b/src/file.rs index 38bd56a..b5d9437 100644 --- a/src/file.rs +++ b/src/file.rs @@ -18,7 +18,8 @@ use ansi_term::Colour::{Red, Green, Yellow, Blue, Purple, Cyan, Fixed}; use users::Users; use locale; -use output::details::UserLocale; + +use unicode_width::UnicodeWidthStr; use number_prefix::{binary_prefix, decimal_prefix, Prefixed, Standalone, PrefixNames}; @@ -30,6 +31,7 @@ use column::Column::*; use dir::Dir; use filetype::HasType; use options::{SizeFormat, TimeType}; +use output::details::UserLocale; use feature::Attribute; /// This grey value is directly in between white and black, so it's guaranteed @@ -216,7 +218,7 @@ impl<'a> File<'a> { /// characters are 1 columns wide, but in some contexts, certain /// characters are actually 2 columns wide. pub fn file_name_width(&self) -> usize { - self.name.width(false) + UnicodeWidthStr::width(&self.name[..]) } /// Assuming the current file is a symlink, follows the link and |