Skip to content

Don't run rust check in CI, so that clippy actually works #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ jobs:
command: |
rustup component add rustfmt
rustup component add clippy
- run:
name: Check
command: cargo check --all-targets --all-features
- run:
name: Rustfmt
command: cargo fmt -- --check
Expand Down
9 changes: 5 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,16 @@ fn heartbeat(req: &HttpRequest<State>) -> FutureResponse<HttpResponse> {
Ok(country_info) => country_info
.and_then(|country_info| country_info.country)
.and_then(|country| country.iso_code)
.and_then(|iso_code| Some(Ok(iso_code == "US".to_string())))
.and_then(|iso_code| Some(Ok(iso_code == "US")))
.unwrap_or(Ok(false)),
Err(_) => Ok(false),
})
.or_else(|_| Ok(false))
.and_then(|res| {
let mut resp = match res {
true => HttpResponse::Ok(),
false => HttpResponse::ServiceUnavailable(),
let mut resp = if res {
HttpResponse::Ok()
} else {
HttpResponse::ServiceUnavailable()
};
Ok(resp.json(HeartbeatResponse { geoip: res }))
}),
Expand Down