summaryrefslogtreecommitdiffstats
path: root/src/format.rs
diff options
context:
space:
mode:
authorpierresy <pierre-henri.symoneaux@alcatel-lucent.com>2015-08-12 13:53:07 +0200
committerpierresy <pierre-henri.symoneaux@alcatel-lucent.com>2015-08-12 13:53:07 +0200
commit97d22d53eb7c7144e18aa6f419f8ff8dacc5ba52 (patch)
treed5446463192ee2ffeb614b5c041d96d9235f92d7 /src/format.rs
parent7a800eb1ae6d3c93220f59ae995e492c0fd8a1e1 (diff)
Added customizable alignment
Added customizable alignment for text in cells (left, center, right). Also with additional small improvements
Diffstat (limited to 'src/format.rs')
-rw-r--r--src/format.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/format.rs b/src/format.rs
index 2ccb02a..048d6d1 100644
--- a/src/format.rs
+++ b/src/format.rs
@@ -2,7 +2,15 @@
use std::io::{Write, Error};
-use super::utils::LINEFEED;
+use super::utils::NEWLINE;
+
+/// Alignment for cell's content
+#[derive(Clone, Debug)]
+pub enum Align {
+ LEFT,
+ CENTER,
+ RIGHT
+}
/// Contains the character used for printing a line separator
#[derive(Clone, Debug)]
@@ -26,7 +34,7 @@ impl LineSeparator {
try!(out.write_all(&vec![self.line[0]; width+2]));
try!(out.write_all(&self.cross));
}
- return out.write_all(LINEFEED);
+ return out.write_all(NEWLINE);
}
}