lib: Implement add_link()

This commit is contained in:
Matthias Beyer 2016-02-15 13:18:57 +01:00
parent 339ec08a83
commit b7a5f57e3a
1 changed files with 4 additions and 1 deletions

View File

@ -19,7 +19,10 @@ pub fn set_links(header: &mut EntryHeader, links: Links) -> Result<Links> {
}
pub fn add_link(header: &mut EntryHeader, link: Link) -> Result<()> {
unimplemented!()
get_links(header).and_then(|mut links| {
links.add(link);
set_links(header, links).map(|_| ())
})
}
fn process_rw_result(links: StoreResult<Option<Value>>) -> Result<Links> {