summaryrefslogtreecommitdiffstats
path: root/src/common/mod.rs
diff options
context:
space:
mode:
authorPaul Masurel <paul.masurel@gmail.com>2016-09-22 15:45:37 +0900
committerPaul Masurel <paul.masurel@gmail.com>2016-09-22 15:45:37 +0900
commit1a08ca4f95b690c6d4ae3f737dd8ab41380dbb82 (patch)
treec090b5fef88944e21ef960cae4a5aa05afbd50db /src/common/mod.rs
parentca331e7fe54fbc892b4fa0bb4a1efbb143dec2a1 (diff)
Doc
Diffstat (limited to 'src/common/mod.rs')
-rw-r--r--src/common/mod.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/common/mod.rs b/src/common/mod.rs
index d3beadb..e4322d2 100644
--- a/src/common/mod.rs
+++ b/src/common/mod.rs
@@ -14,8 +14,13 @@ pub fn make_io_err(msg: String) -> io::Error {
io::Error::new(io::ErrorKind::Other, msg)
}
+
+/// Has length trait
pub trait HasLen {
+ /// Return length
fn len(&self,) -> usize;
+
+ /// Returns true iff empty.
fn is_empty(&self,) -> bool {
self.len() == 0
}