Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -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"
Expand Down
1 change: 0 additions & 1 deletion src/blocking/clients.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
//! Contains implementations of [Client][crate::blocking::client::Client] which
//! use varying blocking HTTP clients.
#[cfg(feature = "reqwest")]
pub mod reqwest;
1 change: 0 additions & 1 deletion src/clients.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
//! Contains implementations of [Client][crate::client::Client] which use
//! varying HTTP clients.
#[cfg(feature = "reqwest")]
pub mod reqwest;
2 changes: 1 addition & 1 deletion src/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ pub trait Endpoint: Send + Sync + Sized {
Ok(EndpointResult::new(resp, Self::RESPONSE_BODY_TYPE))
}

fn with_middleware<M: MiddleWare>(self, middleware: &M) -> MutatedEndpoint<Self, M> {
fn with_middleware<M: MiddleWare>(self, middleware: &M) -> MutatedEndpoint<'_, Self, M> {
MutatedEndpoint::new(self, middleware)
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
//!
Expand Down
2 changes: 1 addition & 1 deletion tests/macro/empty_attr.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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
39 changes: 19 additions & 20 deletions tests/macro/invalid_data.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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<u8>`, found `String`
| arguments to this enum variant are incorrect
|
= note: expected struct `Vec<u8>`
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<u8>`, found `String`
| arguments to this enum variant are incorrect
|
= note: expected struct `Vec<u8>`
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<u8>`
|
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)
2 changes: 1 addition & 1 deletion tests/macro/invalid_method.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/macro/invalid_result.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion tests/macro/invalid_type.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/macro/no_attr.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion tests/macro/no_path.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading