File tree 2 files changed +8
-1
lines changed
2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,9 @@ fn main() {
41
41
}
42
42
43
43
let problem = problem:: get_problem ( id)
44
- . expect ( & format ! ( "problem #{} not found" , id) ) ;
44
+ . expect ( & format ! ( "Error: failed to get problem #{} \
45
+ (The problem may be paid-only or may not be exist).",
46
+ id) ) ;
45
47
let code = problem. code_definition . iter ( )
46
48
. filter ( |& d| { d. value == "rust" } )
47
49
. next ( ) ;
Original file line number Diff line number Diff line change @@ -21,6 +21,11 @@ pub fn get_problem(id: u32) -> Option<Problem> {
21
21
let problems = get_problems ( ) . unwrap ( ) ;
22
22
for problem in problems. stat_status_pairs . iter ( ) {
23
23
if problem. stat . question_id == id {
24
+
25
+ if problem. paid_only {
26
+ return None
27
+ }
28
+
24
29
let client = reqwest:: Client :: new ( ) ;
25
30
let resp: RawProblem = client. post ( GRAPHQL_URL )
26
31
. json ( & Query :: question_query ( problem. stat . question_title_slug . as_ref ( ) . unwrap ( ) ) )
You can’t perform that action at this time.
0 commit comments