@@ -44,8 +44,7 @@ impl UserApi {
4444
4545let client = reqwest:: Client :: builder ( )
4646. default_headers ( headers)
47- . build ( )
48- . unwrap ( ) ;
47+ . build ( ) ?;
4948
5049Ok ( Self { client} )
5150}
@@ -82,7 +81,7 @@ impl UserApi {
8281"query" : query,
8382} ) ;
8483
85- let query = serde_json:: to_string ( & json_data) . unwrap ( ) ;
84+ let query = serde_json:: to_string ( & json_data) ? ;
8685
8786let client = reqwest:: Client :: new ( ) ;
8887
@@ -91,8 +90,7 @@ impl UserApi {
9190. body ( query)
9291. headers ( headers)
9392. send ( )
94- . await
95- . unwrap ( )
93+ . await ?
9694. text ( )
9795. await
9896{
@@ -137,15 +135,14 @@ impl UserApi {
137135"query" : "query questionData($titleSlug: String!) {\n question(titleSlug: $titleSlug) {\n questionId\n questionFrontendId\n boundTopicId\n title\n titleSlug\n content\n translatedTitle\n translatedContent\n isPaidOnly\n canSeeQuestion\n difficulty\n likes\n dislikes\n isLiked\n similarQuestions\n exampleTestcases\n categoryTitle\n contributors {\n username\n profileUrl\n avatarUrl\n __typename\n }\n topicTags {\n name\n slug\n translatedName\n __typename\n }\n companyTagStats\n codeSnippets {\n lang\n langSlug\n code\n __typename\n }\n stats\n hints\n solution {\n id\n canSeeDetail\n paidOnly\n hasVideoSolution\n paidOnlyVideo\n __typename\n }\n status\n sampleTestCase\n metaData\n judgerAvailable\n judgeType\n mysqlSchemas\n enableRunCode\n enableTestMode\n enableDebugger\n envInfo\n libraryUrl\n adminUrl\n challengeQuestion {\n id\n date\n incompleteChallengeCount\n streakCount\n type\n __typename\n }\n __typename\n }\n }"
138136} ) ;
139137
140- let query = serde_json:: to_string ( & json_obj) . unwrap ( ) ;
138+ let query = serde_json:: to_string ( & json_obj) ? ;
141139
142140let full_data =match self
143141. client
144142. post ( "https://leetcode.com/graphql/" )
145143. body ( query)
146144. send ( )
147- . await
148- . unwrap ( )
145+ . await ?
149146. json :: < ProblemFullData > ( )
150147. await
151148{
@@ -174,15 +171,14 @@ impl UserApi {
174171"operationName" : "problemsetQuestionList"
175172} ) ;
176173
177- let query = serde_json:: to_string ( & query) . unwrap ( ) ;
174+ let query = serde_json:: to_string ( & query) ? ;
178175
179176let task_info =self
180177. client
181178. get ( "https://leetcode.com/graphql/" )
182179. body ( query)
183180. send ( )
184- . await
185- . unwrap ( )
181+ . await ?
186182. text ( )
187183. await ;
188184
@@ -217,15 +213,14 @@ impl UserApi {
217213"operationName" : "problemsetQuestionList"
218214} ) ;
219215
220- let query = serde_json:: to_string ( & query) . unwrap ( ) ;
216+ let query = serde_json:: to_string ( & query) ? ;
221217
222218let task_info =self
223219. client
224220. get ( "https://leetcode.com/graphql/" )
225221. body ( query)
226222. send ( )
227- . await
228- . unwrap ( )
223+ . await ?
229224. text ( )
230225. await ;
231226