summary refs log tree commit diff stats
path: root/src/data.rs
blob: 4966e88447854495dd9019d781b253d07d80768b (plain) (blame)
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
27
28
use serde_derive::{Deserialize, Serialize};

#[derive(Deserialize, Serialize)]
pub struct Data {
    pub last_chapter: LastChapter,
}

#[derive(Deserialize, Serialize)]
pub struct LastChapter {
    pub user_name: String,
    pub number: u32,
}


//fn main() {
//    let config: Config = toml::from_str(r#"
//        ip = '127.0.0.1'
//
//        [keys]
//        github = 'xxxxxxxxxxxxxxxxx'
//        travis = 'yyyyyyyyyyyyyyyyy'
//    "#).unwrap();
//
//    assert_eq!(config.ip, "127.0.0.1");
//    assert_eq!(config.port, None);
//    assert_eq!(config.keys.github, "xxxxxxxxxxxxxxxxx");
//    assert_eq!(config.keys.travis.as_ref().unwrap(), "yyyyyyyyyyyyyyyyy");
//}