Add impl Annotateable::annotate_with_path_generator() for FileLockEntry

This commit is contained in:
Matthias Beyer 2016-10-13 15:57:16 +02:00
parent 956b3dbf38
commit cb45c91fa5

View file

@ -71,5 +71,13 @@ impl Annotateable for FileLockEntry {
fn annotate_with_path_generator(&self, store: &Store, pg: &AnnotationPathGenerator)
-> Result<Annotation>
{
pb.generate_annotation_path()
.and_then(|id| store.create(id).map_err_into(AEK::StoreWriteError))
.and_then(|mut fle| {
self.add_internal_link(&mut fle)
.map_err_into(AEK::LinkingError)
.map(|_| fle)
})
.map(Annotation)
}
}