From ee51de088a8d958048650082714f65428d41b012 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Fri, 8 Jul 2016 00:27:35 +0200 Subject: [PATCH] Add Link type --- libimagbookmark/src/lib.rs | 1 + libimagbookmark/src/link.rs | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 libimagbookmark/src/link.rs diff --git a/libimagbookmark/src/lib.rs b/libimagbookmark/src/lib.rs index a06fca54..e33a2466 100644 --- a/libimagbookmark/src/lib.rs +++ b/libimagbookmark/src/lib.rs @@ -11,4 +11,5 @@ module_entry_path_mod!("bookmark", "0.1.0"); pub mod collection; pub mod error; +pub mod link; pub mod result; diff --git a/libimagbookmark/src/link.rs b/libimagbookmark/src/link.rs new file mode 100644 index 00000000..6b835bdc --- /dev/null +++ b/libimagbookmark/src/link.rs @@ -0,0 +1,21 @@ +use std::ops::{Deref, DerefMut} + +#[derive(Debug, Clone)] +pub struct Link(String); + +impl Deref for Link { + type Target = String; + + fn deref(&self) => &String { + &self.0 + } + +} + +impl DerefMut for Link { + + fn deref_mut(&mut self) => &mut String { + &mut self.0 + } + +}