summaryrefslogtreecommitdiffstats
path: root/libimagtodo
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2016-07-06 20:04:22 +0200
committerMatthias Beyer <mail@beyermatthias.de>2016-07-21 17:14:11 +0200
commitf3dc1e90af12a9477f80f7f9c575c9f591bdf040 (patch)
tree2a8302893904a98f34331625cd532a5bb4ad8193 /libimagtodo
parentb12974043dd150adaf13ad33d76b49efe1356c15 (diff)
The Task type can have a unnamed member
Diffstat (limited to 'libimagtodo')
-rw-r--r--libimagtodo/src/task.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/libimagtodo/src/task.rs b/libimagtodo/src/task.rs
index 277a5e40..87429683 100644
--- a/libimagtodo/src/task.rs
+++ b/libimagtodo/src/task.rs
@@ -12,17 +12,13 @@ use result::Result;
/// Task struct containing a `FileLockEntry`
#[derive(Debug)]
-pub struct Task<'a> {
- pub flentry : FileLockEntry<'a>,
-}
+pub struct Task<'a>(FileLockEntry<'a>);
impl<'a> Task<'a> {
/// Concstructs a new `Task` with a `FileLockEntry`
- pub fn new(fle : FileLockEntry<'a>) -> Task<'a> {
- Task {
- flentry : fle
- }
+ pub fn new(fle: FileLockEntry<'a>) -> Task<'a> {
+ Task(fle)
}
}
@@ -79,7 +75,7 @@ impl<'a> IntoTask<'a> for TTask {
}
// If none of the errors above have returned the function, everything is fine
- Ok(Task { flentry : fle } )
+ Ok(Task::new(fle))
}
}
}