11use self :: req:: { Json , Mode , Req } ;
22use crate :: {
3- config:: { self , Config } ,
43 Result ,
4+ config:: { self , Config } ,
55} ;
66use reqwest:: {
7- header:: { HeaderMap , HeaderName , HeaderValue } ,
87 Client , ClientBuilder , Response ,
8+ header:: { HeaderMap , HeaderName , HeaderValue } ,
99} ;
1010use std:: { collections:: HashMap , str:: FromStr , time:: Duration } ;
1111
@@ -86,13 +86,15 @@ impl LeetCode {
8686 json. insert ( "variables" , r#"{"slug": "$slug"}"# . replace ( "$slug" , slug) ) ;
8787 json. insert (
8888 "query" ,
89- [ "query getTopicTag($slug: String!) {" ,
89+ [
90+ "query getTopicTag($slug: String!) {" ,
9091 " topicTag(slug: $slug) {" ,
9192 " questions {" ,
9293 " questionId" ,
9394 " }" ,
9495 " }" ,
95- "}" ]
96+ "}" ,
97+ ]
9698 . join ( "\n " ) ,
9799 ) ;
98100
@@ -149,27 +151,31 @@ impl LeetCode {
149151 json. insert ( "operationName" , "daily" . to_string ( ) ) ;
150152 json. insert (
151153 "query" ,
152- [ "query daily {" ,
154+ [
155+ "query daily {" ,
153156 " activeDailyCodingChallengeQuestion {" ,
154157 " question {" ,
155158 " questionFrontendId" ,
156159 " }" ,
157160 " }" ,
158- "}" ]
161+ "}" ,
162+ ]
159163 . join ( "\n " ) ,
160164 ) ;
161165 }
162166 config:: LeetcodeSite :: LeetcodeCn => {
163167 json. insert ( "operationName" , "questionOfToday" . to_string ( ) ) ;
164168 json. insert (
165169 "query" ,
166- [ "query questionOfToday {" ,
170+ [
171+ "query questionOfToday {" ,
167172 " todayRecord {" ,
168173 " question {" ,
169174 " questionFrontendId" ,
170175 " }" ,
171176 " }" ,
172- "}" ]
177+ "}" ,
178+ ]
173179 . join ( "\n " ) ,
174180 ) ;
175181 }
@@ -195,7 +201,8 @@ impl LeetCode {
195201 let mut json: Json = HashMap :: new ( ) ;
196202 json. insert (
197203 "query" ,
198- [ "query getQuestionDetail($titleSlug: String!) {" ,
204+ [
205+ "query getQuestionDetail($titleSlug: String!) {" ,
199206 " question(titleSlug: $titleSlug) {" ,
200207 " content" ,
201208 " stats" ,
@@ -206,7 +213,8 @@ impl LeetCode {
206213 " metaData" ,
207214 " translatedContent" ,
208215 " }" ,
209- "}" ]
216+ "}" ,
217+ ]
210218 . join ( "\n " ) ,
211219 ) ;
212220
@@ -269,7 +277,7 @@ impl LeetCode {
269277mod req {
270278 use super :: LeetCode ;
271279 use crate :: err:: Error ;
272- use reqwest:: { header :: HeaderMap , Client , Response } ;
280+ use reqwest:: { Client , Response , header :: HeaderMap } ;
273281 use std:: collections:: HashMap ;
274282
275283 /// Standardize json format
0 commit comments