@@ -58,28 +58,36 @@ pub async fn get_in_progress(
58
58
59
59
let mut all_uri = String :: from ( "https://api.github.com/search/issues?q=repo:Rust-GCC/gccrs+type:issue+state:open" ) ;
60
60
let mut no_assignee_uri = String :: from ( "https://api.github.com/search/issues?q=repo:Rust-GCC/gccrs+type:issue+state:open+no:assignee" ) ;
61
+
61
62
if bug
62
63
{
63
64
all_uri. push_str ( "+label:bug" ) ;
64
65
no_assignee_uri. push_str ( "+label:bug" ) ;
65
66
}
66
- let all = gh. _get ( all_uri) . await . unwrap ( ) ;
67
67
68
+ let all = gh. _get ( all_uri) . await . unwrap ( ) ;
68
69
let no_assignee = gh. _get ( no_assignee_uri) . await . unwrap ( ) ;
69
70
70
71
let serres: Value = serde_json:: from_str ( gh. body_to_string ( all) . await . unwrap ( ) . as_str ( ) ) ?;
71
72
let serres_no: Value = serde_json:: from_str ( gh. body_to_string ( no_assignee) . await . unwrap ( ) . as_str ( ) ) ?;
72
- let nb_all = match serres[ "total_count" ] . as_u64 ( )
73
+
74
+ let nb_all = if let Some ( x) = serres[ "total_count" ] . as_u64 ( )
75
+ {
76
+ x
77
+ }
78
+ else
73
79
{
74
- Some ( x) => x,
75
- None => 0
80
+ 0
76
81
} ;
77
-
78
- let nb_no= match serres_no[ "total_count" ] . as_u64 ( )
82
+ let nb_no = if let Some ( x) = serres_no[ "total_count" ] . as_u64 ( )
79
83
{
80
- Some ( x) => x,
81
- None => 0
84
+ x
85
+ }
86
+ else
87
+ {
88
+ 0
82
89
} ;
90
+
83
91
Ok ( nb_all - nb_no)
84
92
}
85
93
@@ -89,21 +97,26 @@ pub async fn get_in_progress(
89
97
) -> Result < u64 , Error > {
90
98
91
99
let mut no_assignee_uri = String :: from ( "https://api.github.com/search/issues?q=repo:Rust-GCC/gccrs+type:issue+state:open+no:assignee" ) ;
100
+
92
101
if bug
93
102
{
94
103
no_assignee_uri. push_str ( "+label:bug" )
95
104
}
105
+
96
106
let no_assignee = gh. _get ( no_assignee_uri) . await . unwrap ( ) ;
97
107
98
108
let serres_no: Value = serde_json:: from_str ( gh. body_to_string ( no_assignee) . await . unwrap ( ) . as_str ( ) ) ?;
99
109
100
- let nb_no= match serres_no[ "total_count" ] . as_u64 ( )
110
+ let nb_no = if let Some ( x ) = serres_no[ "total_count" ] . as_u64 ( )
101
111
{
102
- Some ( x) => x,
103
- None => 0
112
+ x
113
+ }
114
+ else
115
+ {
116
+ 0
104
117
} ;
118
+
105
119
Ok ( nb_no)
106
-
107
120
}
108
121
109
122
pub async fn get_closed (
@@ -112,6 +125,7 @@ pub async fn get_in_progress(
112
125
) -> Result < u64 , Error > {
113
126
114
127
let mut no_assignee_uri = String :: from ( "https://api.github.com/search/issues?q=repo:Rust-GCC/gccrs+type:issue+state:closed" ) ;
128
+
115
129
if bug
116
130
{
117
131
no_assignee_uri. push_str ( "+label:bug" )
@@ -121,11 +135,14 @@ pub async fn get_in_progress(
121
135
122
136
let serres_no: Value = serde_json:: from_str ( gh. body_to_string ( no_assignee) . await . unwrap ( ) . as_str ( ) ) ?;
123
137
124
- let nb_no= match serres_no[ "total_count" ] . as_u64 ( )
138
+ let nb_no = if let Some ( x) = serres_no[ "total_count" ] . as_u64 ( )
139
+ {
140
+ x
141
+ }
142
+ else
125
143
{
126
- Some ( x) => x,
127
- None => 0
144
+ 0
128
145
} ;
146
+
129
147
Ok ( nb_no)
130
-
131
148
}
0 commit comments