Skip to content

Commit 1e9eca0

Browse files
authored
Merge pull request #16 from mozilla/no-check-in-ci
Don't run rust check in CI, so that clippy actually works
2 parents ab14b70 + d0e8c05 commit 1e9eca0

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

.circleci/config.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ jobs:
1111
command: |
1212
rustup component add rustfmt
1313
rustup component add clippy
14-
- run:
15-
name: Check
16-
command: cargo check --all-targets --all-features
1714
- run:
1815
name: Rustfmt
1916
command: cargo fmt -- --check

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)