1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use std::collections::HashMap;

pub mod dao;
pub mod entities;
pub mod leetcode;
pub mod render;

pub type Json = HashMap<&'static str, String>;

use leetcode::LeetCode;
use tokio::sync::OnceCell;

pub static LEETCODE: OnceCell<LeetCode> = OnceCell::const_new();
/// global leetocde
pub async fn glob_leetcode() -> &'static LeetCode {
    LEETCODE
        .get_or_init(|| async {
            LeetCode::build()
                .await
                .expect("new `LeetCode` failed")
        })
        .await
}