diff options
author | Ben S <ogham@bsago.me> | 2015-02-13 21:24:10 +0000 |
---|---|---|
committer | Ben S <ogham@bsago.me> | 2015-02-13 21:24:10 +0000 |
commit | d180a5f5e42c397f6ea892984136e1317e148edf (patch) | |
tree | 4105545f5ad0084c534f587484f32bddc7ffc427 /src/file.rs | |
parent | 113df664084069cdaa441d733e890e09607ebbb4 (diff) |
Use ansi_term's awesome new continuation colours
Diffstat (limited to 'src/file.rs')
-rw-r--r-- | src/file.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/file.rs b/src/file.rs index 3d42625..48f2535 100644 --- a/src/file.rs +++ b/src/file.rs @@ -2,7 +2,7 @@ use std::old_io::{fs, IoResult}; use std::old_io as io; use std::ascii::AsciiExt; -use ansi_term::{ANSIString, Colour, Style}; +use ansi_term::{ANSIString, ANSIStrings, Colour, Style}; use ansi_term::Style::Plain; use ansi_term::Colour::{Red, Green, Yellow, Blue, Purple, Cyan, Fixed}; @@ -296,7 +296,7 @@ impl<'a> File<'a> { let symbol = prefix.symbol(); Cell { - text: format!("{}{}", Green.bold().paint(&*number), Green.paint(symbol)), + text: ANSIStrings( &[ Green.bold().paint(&number[]), Green.paint(symbol) ]).to_string(), length: number.len() + symbol.len(), } } @@ -352,7 +352,7 @@ impl<'a> File<'a> { _ => Green.bold(), }; - let string = format!("{}{}{}{}{}{}{}{}{}{}", + let string = ANSIStrings(&[ self.type_char(), File::permission_bit(&bits, io::USER_READ, "r", Yellow.bold()), File::permission_bit(&bits, io::USER_WRITE, "w", Red.bold()), @@ -363,7 +363,7 @@ impl<'a> File<'a> { File::permission_bit(&bits, io::OTHER_READ, "r", Yellow.normal()), File::permission_bit(&bits, io::OTHER_WRITE, "w", Red.normal()), File::permission_bit(&bits, io::OTHER_EXECUTE, "x", Green.normal()), - ); + ]).to_string(); Cell { text: string, length: 10 } } |