The Task type can have a unnamed member
This commit is contained in:
parent
b12974043d
commit
f3dc1e90af
1 changed files with 4 additions and 8 deletions
|
@ -12,17 +12,13 @@ use result::Result;
|
||||||
|
|
||||||
/// Task struct containing a `FileLockEntry`
|
/// Task struct containing a `FileLockEntry`
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Task<'a> {
|
pub struct Task<'a>(FileLockEntry<'a>);
|
||||||
pub flentry : FileLockEntry<'a>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'a> Task<'a> {
|
impl<'a> Task<'a> {
|
||||||
|
|
||||||
/// Concstructs a new `Task` with a `FileLockEntry`
|
/// Concstructs a new `Task` with a `FileLockEntry`
|
||||||
pub fn new(fle : FileLockEntry<'a>) -> Task<'a> {
|
pub fn new(fle: FileLockEntry<'a>) -> Task<'a> {
|
||||||
Task {
|
Task(fle)
|
||||||
flentry : fle
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -79,7 +75,7 @@ impl<'a> IntoTask<'a> for TTask {
|
||||||
}
|
}
|
||||||
|
|
||||||
// If none of the errors above have returned the function, everything is fine
|
// If none of the errors above have returned the function, everything is fine
|
||||||
Ok(Task { flentry : fle } )
|
Ok(Task::new(fle))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue