Add Link type
This commit is contained in:
parent
eb47f08479
commit
ee51de088a
2 changed files with 22 additions and 0 deletions
|
@ -11,4 +11,5 @@ module_entry_path_mod!("bookmark", "0.1.0");
|
|||
|
||||
pub mod collection;
|
||||
pub mod error;
|
||||
pub mod link;
|
||||
pub mod result;
|
||||
|
|
21
libimagbookmark/src/link.rs
Normal file
21
libimagbookmark/src/link.rs
Normal file
|
@ -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
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue