Skip to content

Commit

Permalink
refact(features): remove http
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Perkowski <[email protected]>
  • Loading branch information
adamperkowski committed Nov 27, 2024
1 parent 1aeacbc commit 712bcea
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
11 changes: 5 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 0 additions & 2 deletions src/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ pub struct Release {
type ReleaseFuture =
std::pin::Pin<Box<dyn std::future::Future<Output = crate::error::Result<Release>> + Send>>;

#[cfg(feature = "http")]
fn setup_headers() -> reqwest::header::HeaderMap {
use reqwest::header::{HeaderMap, HeaderValue, USER_AGENT};

Expand All @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ newver = \"newver.json\"";

#[derive(Debug, ThisError)]
pub enum Error {
#[cfg(feature = "http")]
#[error("request error: {0}")]
RequestError(#[from] reqwest::Error),

Expand Down

0 comments on commit 712bcea

Please sign in to comment.