Skip to content

Commit d0e8c05

Browse files
committed
Fix clippy problems
1 parent b46a587 commit d0e8c05

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/main.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,15 +216,16 @@ fn heartbeat(req: &HttpRequest<State>) -> FutureResponse<HttpResponse> {
216216
Ok(country_info) => country_info
217217
.and_then(|country_info| country_info.country)
218218
.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")))
220220
.unwrap_or(Ok(false)),
221221
Err(_) => Ok(false),
222222
})
223223
.or_else(|_| Ok(false))
224224
.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()
228229
};
229230
Ok(resp.json(HeartbeatResponse { geoip: res }))
230231
}),

0 commit comments

Comments
 (0)