lib: Add Links::{add,remove}()

This commit is contained in:
Matthias Beyer 2016-02-15 13:18:46 +01:00
parent 6480fb515c
commit 339ec08a83
1 changed files with 8 additions and 0 deletions

View File

@ -26,6 +26,14 @@ impl Links {
Links { links: s }
}
pub fn add(&mut self, l: Link) {
self.links.push(l);
}
pub fn remove(&mut self, l: Link) {
self.links.retain(|link| l != link.clone());
}
}
impl Into<String> for Link {