lib: Implement add_link()

This commit is contained in:
Matthias Beyer 2016-02-15 13:18:57 +01:00
parent 339ec08a83
commit b7a5f57e3a

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> {