diff options
author | Ben S <ogham@bsago.me> | 2014-12-12 14:06:48 +0000 |
---|---|---|
committer | Ben S <ogham@bsago.me> | 2014-12-12 14:06:48 +0000 |
commit | 66339e7a1546a92b1c1fa2935384143e28e11098 (patch) | |
tree | 69e058326dbe551dcc1181cecc6d87ce5493e564 /src/column.rs | |
parent | 4484982734e9c11c7c3845321e9043ece7c7aeb9 (diff) |
Miscellaneous little optimisations
- Prefer iter over into_iter where appropriate
- Cut down on cloning
Diffstat (limited to 'src/column.rs')
-rw-r--r-- | src/column.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/column.rs b/src/column.rs index f583eeb..ec19bb1 100644 --- a/src/column.rs +++ b/src/column.rs @@ -49,8 +49,8 @@ impl Column { impl Alignment { pub fn pad_string(&self, string: &String, padding: uint) -> String { match *self { - Alignment::Left => string.clone() + " ".repeat(padding).as_slice(), - Alignment::Right => " ".repeat(padding) + string.as_slice(), + Alignment::Left => format!("{}{}", string, " ".repeat(padding).as_slice()), + Alignment::Right => format!("{}{}", " ".repeat(padding), string.as_slice()), } } } |