From b07f521fd6373715e820680f7a30f7137c289ce7 Mon Sep 17 00:00:00 2001 From: pravic Date: Mon, 11 Nov 2024 23:50:20 +0300 Subject: [PATCH 1/3] Fixes build with default-features = false. --- src/errors.rs | 3 +++ src/lib.rs | 7 +++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/errors.rs b/src/errors.rs index ddd5ab9..c233daf 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -24,8 +24,11 @@ pub enum ClientError { method: RequestMethod, url: String, }, + + #[cfg(feature = "reqwest")] #[error("Error building request for Reqwest crate")] ReqwestBuildError { source: reqwest::Error }, + #[error("Error retrieving HTTP response")] ResponseError { source: anyhow::Error }, #[error("Error parsing server response as UTF-8")] diff --git a/src/lib.rs b/src/lib.rs index 626cbbf..241f901 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -234,7 +234,6 @@ pub mod http; #[path = "private/mod.rs"] pub mod __private; -pub use crate::{ - clients::reqwest::Client, - endpoint::{Endpoint, MiddleWare, Wrapper}, -}; +#[cfg(feature = "reqwest")] +pub use crate::clients::reqwest::Client; +pub use crate::endpoint::{Endpoint, MiddleWare, Wrapper}; From ecd746b6a7862d4e811bbff11b7c2d16a9759b1c Mon Sep 17 00:00:00 2001 From: pravic Date: Tue, 12 Nov 2024 12:24:19 +0300 Subject: [PATCH 2/3] Check build with `default-features = false`. To prevent #20 from happening. --- .github/workflows/ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 694672f..1ba9f97 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,6 +39,11 @@ jobs: with: command: clippy args: -- -D warnings + - name: Check default-features = false + uses: actions-rs/cargo@v1 + with: + command: clippy + args: --no-default-features -- -D warnings test: name: Run cargo test runs-on: ubuntu-latest @@ -79,4 +84,4 @@ jobs: override: true - uses: katyo/publish-crates@v1 with: - registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} \ No newline at end of file + registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} From 15e1ac7b2fd6e813bb7cde116ec655a017fe8cc9 Mon Sep 17 00:00:00 2001 From: pravic Date: Tue, 12 Nov 2024 13:31:54 +0300 Subject: [PATCH 3/3] Remove newline