diff --git a/.circleci/config.yml b/.circleci/config.yml index 7b15f00..9592042 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 diff --git a/src/main.rs b/src/main.rs index c2f989c..20dc5b4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -216,15 +216,16 @@ fn heartbeat(req: &HttpRequest) -> FutureResponse { 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 })) }),