diff --git a/Cargo.toml b/Cargo.toml index a057989..693db48 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,9 +13,11 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [features] -default = ["reqwest/default-tls"] +default = ["rustls"] +rustls = ["reqwest/rustls"] blocking = ["reqwest/blocking"] -rustls-tls = ["reqwest/rustls-tls"] +native-tls = ["reqwest/native-tls"] +rustls-no-provider = ["reqwest/rustls-no-provider"] [workspace] members = [ @@ -27,7 +29,7 @@ anyhow = "1.0.56" async-trait = "0.1.52" bytes = "1.1.0" http = "1" -reqwest = { version = "0.12.2", default-features = false, optional = true } +reqwest = { version = "0.13.0", default-features = false } rustify_derive = { version = "0.5.4", path = "rustify_derive" } serde = { version = "1.0.136", features = ["derive"] } serde_json = "1.0.79" diff --git a/src/blocking/clients.rs b/src/blocking/clients.rs index cdf1345..151248d 100644 --- a/src/blocking/clients.rs +++ b/src/blocking/clients.rs @@ -1,4 +1,3 @@ //! Contains implementations of [Client][crate::blocking::client::Client] which //! use varying blocking HTTP clients. -#[cfg(feature = "reqwest")] pub mod reqwest; diff --git a/src/clients.rs b/src/clients.rs index 6fd2a25..f5bb2b2 100644 --- a/src/clients.rs +++ b/src/clients.rs @@ -1,4 +1,3 @@ //! Contains implementations of [Client][crate::client::Client] which use //! varying HTTP clients. -#[cfg(feature = "reqwest")] pub mod reqwest; diff --git a/src/endpoint.rs b/src/endpoint.rs index e91a66d..02bb3c8 100644 --- a/src/endpoint.rs +++ b/src/endpoint.rs @@ -239,7 +239,7 @@ pub trait Endpoint: Send + Sync + Sized { Ok(EndpointResult::new(resp, Self::RESPONSE_BODY_TYPE)) } - fn with_middleware(self, middleware: &M) -> MutatedEndpoint { + fn with_middleware(self, middleware: &M) -> MutatedEndpoint<'_, Self, M> { MutatedEndpoint::new(self, middleware) } diff --git a/src/lib.rs b/src/lib.rs index 4b00d11..6976f1f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -194,7 +194,7 @@ //! The following features are available for this crate: //! //! * `blocking`: Enables the blocking variants of `Client`s as well as the blocking -//! `exec()` functions in `Endpoint`s. +//! `exec()` functions in `Endpoint`s. //! //! ## Error Handling //! diff --git a/tests/macro/empty_attr.stderr b/tests/macro/empty_attr.stderr index 3457d18..96f237d 100644 --- a/tests/macro/empty_attr.stderr +++ b/tests/macro/empty_attr.stderr @@ -16,4 +16,4 @@ warning: unused import: `rustify::endpoint::Endpoint` 1 | use rustify::endpoint::Endpoint; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `#[warn(unused_imports)]` on by default + = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default diff --git a/tests/macro/invalid_data.stderr b/tests/macro/invalid_data.stderr index 5f721ad..c068657 100644 --- a/tests/macro/invalid_data.stderr +++ b/tests/macro/invalid_data.stderr @@ -11,28 +11,27 @@ warning: unused import: `rustify::endpoint::Endpoint` 1 | use rustify::endpoint::Endpoint; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `#[warn(unused_imports)]` on by default + = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default error[E0308]: mismatched types --> tests/macro/invalid_data.rs:5:17 | -5 | #[derive(Debug, Endpoint, Serialize)] - | ^^^^^^^^ - | | - | expected `Vec`, found `String` - | arguments to this enum variant are incorrect - | - = note: expected struct `Vec` - found struct `std::string::String` -help: the type constructed contains `std::string::String` due to the type of the argument passed - --> tests/macro/invalid_data.rs:5:17 - | -5 | #[derive(Debug, Endpoint, Serialize)] - | ^^^^^^^^ this argument influences the type of `Some` + 5 | #[derive(Debug, Endpoint, Serialize)] + | ^^^^^^^^ + | | + | expected `Vec`, found `String` + | arguments to this enum variant are incorrect + | + = note: expected struct `Vec` + found struct `String` +help: the type constructed contains `String` due to the type of the argument passed + --> tests/macro/invalid_data.rs:5:17 + | + 5 | #[derive(Debug, Endpoint, Serialize)] + | ^^^^^^^^ this argument influences the type of `Some` note: tuple variant defined here - --> $RUST/core/src/option.rs - = note: this error originates in the derive macro `Endpoint` (in Nightly builds, run with -Z macro-backtrace for more info) -help: call `Into::into` on this expression to convert `std::string::String` into `Vec` - | -5 | #[derive(Debug, Endpoint.into(), Serialize)] - | +++++++ + --> $RUST/core/src/option.rs + | + | Some(#[stable(feature = "rust1", since = "1.0.0")] T), + | ^^^^ + = note: this error originates in the derive macro `Endpoint` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/macro/invalid_method.stderr b/tests/macro/invalid_method.stderr index c04ca07..2b10320 100644 --- a/tests/macro/invalid_method.stderr +++ b/tests/macro/invalid_method.stderr @@ -4,7 +4,7 @@ warning: unused import: `rustify::endpoint::Endpoint` 1 | use rustify::endpoint::Endpoint; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `#[warn(unused_imports)]` on by default + = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default error[E0599]: no variant or associated item named `TEST` found for enum `RequestMethod` in the current scope --> tests/macro/invalid_method.rs:6:41 diff --git a/tests/macro/invalid_result.stderr b/tests/macro/invalid_result.stderr index 08f3adb..0e13b99 100644 --- a/tests/macro/invalid_result.stderr +++ b/tests/macro/invalid_result.stderr @@ -10,4 +10,4 @@ warning: unused import: `rustify::endpoint::Endpoint` 1 | use rustify::endpoint::Endpoint; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `#[warn(unused_imports)]` on by default + = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default diff --git a/tests/macro/invalid_type.stderr b/tests/macro/invalid_type.stderr index b041ce7..a36a779 100644 --- a/tests/macro/invalid_type.stderr +++ b/tests/macro/invalid_type.stderr @@ -4,7 +4,7 @@ warning: unused import: `rustify::endpoint::Endpoint` 1 | use rustify::endpoint::Endpoint; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `#[warn(unused_imports)]` on by default + = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default error[E0599]: no variant or associated item named `BAD` found for enum `RequestType` in the current scope --> tests/macro/invalid_type.rs:6:47 diff --git a/tests/macro/no_attr.stderr b/tests/macro/no_attr.stderr index 07d7749..9a5035d 100644 --- a/tests/macro/no_attr.stderr +++ b/tests/macro/no_attr.stderr @@ -12,4 +12,4 @@ warning: unused import: `rustify::endpoint::Endpoint` 1 | use rustify::endpoint::Endpoint; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `#[warn(unused_imports)]` on by default + = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default diff --git a/tests/macro/no_path.stderr b/tests/macro/no_path.stderr index a3ab12a..902edd5 100644 --- a/tests/macro/no_path.stderr +++ b/tests/macro/no_path.stderr @@ -12,4 +12,4 @@ warning: unused import: `rustify::endpoint::Endpoint` 1 | use rustify::endpoint::Endpoint; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: `#[warn(unused_imports)]` on by default + = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default