diff options
Diffstat (limited to 'libimaglink/src/link.rs')
-rw-r--r-- | libimaglink/src/link.rs | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/libimaglink/src/link.rs b/libimaglink/src/link.rs deleted file mode 100644 index c811f98b..00000000 --- a/libimaglink/src/link.rs +++ /dev/null @@ -1,54 +0,0 @@ -use std::convert::Into; - -use libimagstore::store::Entry; - -#[derive(PartialOrd, Ord, Eq, PartialEq, Clone, Debug)] -pub struct Link { - link: String -} - -impl Link { - - pub fn new(s: String) -> Link { - Link { link: s } - } - -} - -#[derive(Eq, PartialEq, Clone, Debug)] -pub struct Links { - links: Vec<Link>, -} - -impl Links { - - pub fn new(s: Vec<Link>) -> 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 { - - fn into(self) -> String { - self.link - } - -} - -impl Into<Vec<Link>> for Links { - - fn into(self) -> Vec<Link> { - self.links - } - -} - |