diff --git a/libimagtodo/src/task.rs b/libimagtodo/src/task.rs index 87429683..0c68e4c0 100644 --- a/libimagtodo/src/task.rs +++ b/libimagtodo/src/task.rs @@ -1,4 +1,6 @@ use std::collections::BTreeMap; +use std::ops::{Deref, DerefMut}; + use toml::Value; use task_hookrs::task::Task as TTask; @@ -23,6 +25,23 @@ impl<'a> Task<'a> { } +impl<'a> Deref for Task<'a> { + type Target = FileLockEntry<'a>; + + fn deref(&self) -> &FileLockEntry<'a> { + &self.0 + } + +} + +impl<'a> DerefMut for Task<'a> { + + fn deref_mut(&mut self) -> &mut FileLockEntry<'a> { + &mut self.0 + } + +} + /// A trait to get a `libimagtodo::task::Task` out of the implementing object. /// This Task struct is merely a wrapper for a `FileLockEntry`, therefore the function name /// `into_filelockentry`.