diff options
author | Ben S <ogham@bsago.me> | 2014-11-23 21:29:11 +0000 |
---|---|---|
committer | Ben S <ogham@bsago.me> | 2014-11-23 21:29:11 +0000 |
commit | 933f98d2c3734a69260b6d10ae059130417ae813 (patch) | |
tree | 8eedebcd31602a20eb15f5b1a0bf2100472f4e27 /src/column.rs | |
parent | 26f8ad08bf508bfab78fc17a477ed839960634f5 (diff) |
Upgrade to latest Rust nightly
Diffstat (limited to 'src/column.rs')
-rw-r--r-- | src/column.rs | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/column.rs b/src/column.rs index 1839275..132497a 100644 --- a/src/column.rs +++ b/src/column.rs @@ -19,24 +19,24 @@ pub enum Alignment { impl Column { pub fn alignment(&self) -> Alignment { match *self { - FileSize(_) => Right, - HardLinks => Right, - Inode => Right, - Blocks => Right, - _ => Left, + Column::FileSize(_) => Alignment::Right, + Column::HardLinks => Alignment::Right, + Column::Inode => Alignment::Right, + Column::Blocks => Alignment::Right, + _ => Alignment::Left, } } pub fn header(&self) -> &'static str { match *self { - Permissions => "Permissions", - FileName => "Name", - FileSize(_) => "Size", - Blocks => "Blocks", - User => "User", - Group => "Group", - HardLinks => "Links", - Inode => "inode", + Column::Permissions => "Permissions", + Column::FileName => "Name", + Column::FileSize(_) => "Size", + Column::Blocks => "Blocks", + Column::User => "User", + Column::Group => "Group", + Column::HardLinks => "Links", + Column::Inode => "inode", } } } @@ -49,8 +49,8 @@ impl Column { impl Alignment { pub fn pad_string(&self, string: &String, padding: uint) -> String { match *self { - Left => string.clone().append(" ".to_string().repeat(padding).as_slice()), - Right => " ".to_string().repeat(padding).append(string.as_slice()), + Alignment::Left => string.clone() + " ".to_string().repeat(padding).as_slice(), + Alignment::Right => " ".to_string().repeat(padding) + string.as_slice(), } } } |