leetcode-core 0.5.2

This library helps to talk to leetcode APIs via REST interface
Documentation
use super::GQLLeetcodeRequest;
use serde::Serialize;

const QUERY: &str = r#"
query questionContent($titleSlug: String!) {
  question(titleSlug: $titleSlug) {
    content
    titleSlug
  }
}
"#;

#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
struct Variables {
    title_slug: String,
}

#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Query {
    query: &'static str,
    variables: Variables,
}

impl Query {
    pub fn new(title_slug: String) -> Self {
        Self {
            query: QUERY,
            variables: Variables { title_slug },
        }
    }
}

impl GQLLeetcodeRequest for Query {
    type T = crate::types::question_content::Data;

    fn use_cache(&self) -> bool {
        true
    }
}