diff options
Diffstat (limited to 'src/common/mod.rs')
-rw-r--r-- | src/common/mod.rs | 5 |
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 } |