Unnamed repository; edit this file 'description' to name the repository.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
use std::ops::{Deref, DerefMut};
use serde::{Deserialize, Serialize};
#[derive(Clone, Serialize, Deserialize, Default, Debug)]
pub struct Bookmark {
pub position: usize,
pub text: String,
}
#[derive(Clone, Serialize, Deserialize, Default, Debug)]
pub struct Bookmarks(pub Vec<Bookmark>);
impl DerefMut for Bookmarks {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl Deref for Bookmarks {
type Target = Vec<Bookmark>;
fn deref(&self) -> &Self::Target {
&self.0
}
}
|