Skip to content

Commit

Permalink
Clippy!
Browse files Browse the repository at this point in the history
  • Loading branch information
westy92 committed Jul 25, 2023
1 parent 1fb1b8d commit 593f54f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ jobs:
- name: Lint
run: cargo fmt --all -- --check

- name: Clippy
run: cargo clippy

- name: Install tarpaulin
if: ${{ matrix.os == 'ubuntu-latest' }}
run: cargo install cargo-tarpaulin
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ static APP_USER_AGENT: &str = concat!("HolidayApiRust/", env!("CARGO_PKG_VERSION

impl HolidayEventApi {
pub fn new(api_key: String, base_url: Option<String>) -> Result<Self, String> {
let api_key_header = HeaderValue::from_str(&api_key.as_str());
let api_key_header = HeaderValue::from_str(api_key.as_str());
if api_key.is_empty() || api_key_header.is_err() {
return Err("Please provide a valid API key. Get one at https://apilayer.com/marketplace/checkiday-api#pricing.".into());
}
Expand Down Expand Up @@ -122,7 +122,7 @@ impl HolidayEventApi {
let res = self.client.get(url).send().await;
if res.is_err() {
let err = res.unwrap_err().to_string();
return Err(format!("Can't process request: {err}").into());
return Err(format!("Can't process request: {err}"));
}
let res = res.unwrap();
let status = res.status();
Expand Down

0 comments on commit 593f54f

Please sign in to comment.