From 712bceae2626838af664df10dd967cb4a2819ab8 Mon Sep 17 00:00:00 2001 From: Adam Perkowski Date: Wed, 27 Nov 2024 16:37:17 +0100 Subject: [PATCH] refact(features): remove `http` Signed-off-by: Adam Perkowski --- Cargo.toml | 11 +++++------ src/api/mod.rs | 2 -- src/error.rs | 1 - 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a09011f..d6eab03 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,17 +20,16 @@ include = [ ] [features] -default = ["http", "aur", "github", "gitlab"] -http = ["reqwest"] -aur = ["http"] -github = ["http"] -gitlab = ["http"] +default = ["aur", "github", "gitlab"] +aur = [] +github = [] +gitlab = [] [dependencies] clap = { version = "4.5.21", features = ["derive", "color", "error-context", "help", "std", "usage"], default-features = false } colored = "2.1.0" futures = "0.3.31" -reqwest = { version = "0.12.9", features = ["__tls", "charset", "default-tls", "h2", "http2", "json"], default-features = false, optional = true } +reqwest = { version = "0.12.9", features = ["__tls", "charset", "default-tls", "h2", "http2", "json"], default-features = false } serde = { version = "1.0.215", features = ["derive"], default-features = false } serde_json = "1.0.132" thiserror = "2.0.3" diff --git a/src/api/mod.rs b/src/api/mod.rs index 7d1f29a..c904ccd 100644 --- a/src/api/mod.rs +++ b/src/api/mod.rs @@ -34,7 +34,6 @@ pub struct Release { type ReleaseFuture = std::pin::Pin> + Send>>; -#[cfg(feature = "http")] fn setup_headers() -> reqwest::header::HeaderMap { use reqwest::header::{HeaderMap, HeaderValue, USER_AGENT}; @@ -44,7 +43,6 @@ fn setup_headers() -> reqwest::header::HeaderMap { headers } -#[cfg(feature = "http")] fn match_statuscode(status: &reqwest::StatusCode, package: String) -> crate::error::Result<()> { use crate::error; use reqwest::StatusCode; diff --git a/src/error.rs b/src/error.rs index 95a3166..50d6762 100644 --- a/src/error.rs +++ b/src/error.rs @@ -14,7 +14,6 @@ newver = \"newver.json\""; #[derive(Debug, ThisError)] pub enum Error { - #[cfg(feature = "http")] #[error("request error: {0}")] RequestError(#[from] reqwest::Error),