From cb45c91fa523bd71fd38b3cab3e67c47eaad0c2a Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 13 Oct 2016 15:57:16 +0200 Subject: [PATCH] Add impl Annotateable::annotate_with_path_generator() for FileLockEntry --- libimagannotation/src/annotation.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libimagannotation/src/annotation.rs b/libimagannotation/src/annotation.rs index 33dd3644..5e2ad2fc 100644 --- a/libimagannotation/src/annotation.rs +++ b/libimagannotation/src/annotation.rs @@ -71,5 +71,13 @@ impl Annotateable for FileLockEntry { fn annotate_with_path_generator(&self, store: &Store, pg: &AnnotationPathGenerator) -> Result { + 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) } }