File tree 2 files changed +5
-7
lines changed
2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change 11
11
command : |
12
12
rustup component add rustfmt
13
13
rustup component add clippy
14
- - run :
15
- name : Check
16
- command : cargo check --all-targets --all-features
17
14
- run :
18
15
name : Rustfmt
19
16
command : cargo fmt -- --check
Original file line number Diff line number Diff line change @@ -216,15 +216,16 @@ fn heartbeat(req: &HttpRequest<State>) -> FutureResponse<HttpResponse> {
216
216
Ok ( country_info) => country_info
217
217
. and_then ( |country_info| country_info. country )
218
218
. and_then ( |country| country. iso_code )
219
- . and_then ( |iso_code| Some ( Ok ( iso_code == "US" . to_string ( ) ) ) )
219
+ . and_then ( |iso_code| Some ( Ok ( iso_code == "US" ) ) )
220
220
. unwrap_or ( Ok ( false ) ) ,
221
221
Err ( _) => Ok ( false ) ,
222
222
} )
223
223
. or_else ( |_| Ok ( false ) )
224
224
. and_then ( |res| {
225
- let mut resp = match res {
226
- true => HttpResponse :: Ok ( ) ,
227
- false => HttpResponse :: ServiceUnavailable ( ) ,
225
+ let mut resp = if res {
226
+ HttpResponse :: Ok ( )
227
+ } else {
228
+ HttpResponse :: ServiceUnavailable ( )
228
229
} ;
229
230
Ok ( resp. json ( HeartbeatResponse { geoip : res } ) )
230
231
} ) ,
You can’t perform that action at this time.
0 commit comments