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
pub mod albums;
pub mod comments;
pub mod photos;
pub mod posts;
pub mod todos;
pub mod users;

pub const PLACEHOLDER_BASE: &str = "https://jsonplaceholder.typicode.com/";


macro_rules! from_json {
    ($data:expr) => {
        serde_json::from_str($data).unwrap()
    };
}
pub(crate) use from_json;
    
macro_rules! by_id {
    ($id:expr) => {
        get_all()
            .into_iter()
            .filter(|data| data.id == Some($id))
            .last()
            .unwrap()
    };
}    
pub(crate) use by_id;