Skip to content

Commit 54b3eb6

Browse files
authored
fix ci and add unix-sock-client feature (#1159)
* fix ci and add unix-sock-client * wip * wip
1 parent 16eabd8 commit 54b3eb6

File tree

11 files changed

+21
-17
lines changed

11 files changed

+21
-17
lines changed

crates/core/src/rt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#[doc(hidden)]
77
pub use hyper::rt::*;
88

9-
/// Tokio runtimes
9+
/// Tokio runtime
1010
pub mod tokio {
1111
pub use hyper_util::rt::{TokioExecutor, TokioIo};
1212
}

crates/macros/src/shared.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub(crate) fn salvo_crate() -> syn::Ident {
3131
}
3232
}
3333

34-
pub(crate) fn parse_input_type(input: &FnArg) -> InputType {
34+
pub(crate) fn parse_input_type(input: &FnArg) -> InputType<'_> {
3535
if let FnArg::Typed(p) = input {
3636
if let Type::Reference(ty) = &*p.ty {
3737
if let syn::Type::Path(nty) = &*ty.elem {

crates/oapi-macros/src/feature/attributes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ impl_get_name!(Format = "format");
205205
pub(crate) struct ValueType(pub(crate) syn::Type);
206206
impl ValueType {
207207
/// Create [`TypeTree`] from current [`syn::Type`].
208-
pub(crate) fn as_type_tree(&self) -> DiagResult<TypeTree> {
208+
pub(crate) fn as_type_tree(&self) -> DiagResult<TypeTree<'_>> {
209209
TypeTree::from_type(&self.0)
210210
}
211211
}

crates/oapi-macros/src/operation/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ pub(crate) struct InlineType<'i> {
313313

314314
impl InlineType<'_> {
315315
/// Get's the underlying [`syn::Type`] as [`TypeTree`].
316-
pub(crate) fn as_type_tree(&self) -> DiagResult<TypeTree> {
316+
pub(crate) fn as_type_tree(&self) -> DiagResult<TypeTree<'_>> {
317317
TypeTree::from_type(&self.ty)
318318
}
319319
}

crates/oapi-macros/src/response/derive.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ impl<'r> EnumResponse<'r> {
553553
Ok(Self(response_value.into()))
554554
}
555555

556-
fn parse_variant_attributes(variant: &Variant) -> DiagResult<VariantAttributes> {
556+
fn parse_variant_attributes(variant: &Variant) -> DiagResult<VariantAttributes<'_>> {
557557
let variant_derive_response_value =
558558
DeriveToResponseValue::from_attributes(variant.attrs.as_slice())?;
559559
// named enum variant should not have field attributes
@@ -612,7 +612,7 @@ impl<'r> EnumResponse<'r> {
612612
type_and_content: field_and_content,
613613
mut derive_value,
614614
is_inline,
615-
}: VariantAttributes,
615+
}: VariantAttributes<'_>,
616616
) -> Option<Content<'_>> {
617617
let (example, examples) = if let Some(variant_derive) = &mut derive_value {
618618
(

crates/oapi-macros/src/response/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -627,12 +627,12 @@ impl Parse for DeriveToResponsesValue {
627627
pub(crate) struct ResponseStatusCode(TokenStream);
628628

629629
impl Parse for ResponseStatusCode {
630-
fn parse(input: ParseStream) -> syn::Result<Self> {
631-
fn parse_lit_int(input: ParseStream) -> syn::Result<Cow<'_, str>> {
630+
fn parse(input: ParseStream<'_>) -> syn::Result<Self> {
631+
fn parse_lit_int(input: ParseStream<'_>) -> syn::Result<Cow<'_, str>> {
632632
input.parse::<LitInt>()?.base10_parse().map(Cow::Owned)
633633
}
634634

635-
fn parse_lit_str_status_range(input: ParseStream) -> syn::Result<Cow<'_, str>> {
635+
fn parse_lit_str_status_range(input: ParseStream<'_>) -> syn::Result<Cow<'_, str>> {
636636
const VALID_STATUS_RANGES: [&str; 6] = ["default", "1XX", "2XX", "3XX", "4XX", "5XX"];
637637

638638
input

crates/oapi-macros/src/shared.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub(crate) fn salvo_crate() -> syn::Ident {
5454
}
5555
}
5656

57-
pub(crate) fn parse_input_type(input: &FnArg) -> InputType {
57+
pub(crate) fn parse_input_type(input: &FnArg) -> InputType<'_> {
5858
if let FnArg::Typed(p) = input {
5959
if let Type::Reference(ty) = &*p.ty {
6060
if let syn::Type::Path(nty) = &*ty.elem {

crates/oapi-macros/src/type_tree.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl<'t> TypeTree<'t> {
4545
Self::from_type_paths(Self::get_type_paths(ty)?)
4646
}
4747

48-
fn get_type_paths(ty: &Type) -> DiagResult<Vec<TypeTreeValue>> {
48+
fn get_type_paths(ty: &Type) -> DiagResult<Vec<TypeTreeValue<'_>>> {
4949
let type_tree_values = match ty {
5050
Type::Path(path) => {
5151
vec![TypeTreeValue::TypePath(path)]

crates/proxy/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@ all-features = true
2020
rustdoc-args = ["--cfg", "docsrs"]
2121

2222
[features]
23-
default = ["ring", "hyper-client"]
23+
default = ["ring", "hyper-client", "unix-sock-client"]
2424
full = ["ring", "hyper-client", "reqwest-client"]
2525
# aws-lc-rs = ["hyper-rustls/aws-lc-rs"]
2626
ring = ["hyper-rustls/ring"]
2727
hyper-client = ["dep:hyper-util", "dep:hyper-rustls"]
2828
reqwest-client = ["dep:reqwest"]
29+
unix-sock-client = []
2930

3031
[dependencies]
3132
futures-util = { workspace = true, default-features = false }

crates/proxy/src/lib.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,13 @@ cfg_feature! {
6262
pub use reqwest_client::*;
6363
}
6464

65-
#[cfg(unix)]
66-
mod unix_sock_client;
67-
#[cfg(unix)]
68-
pub use unix_sock_client::*;
65+
cfg_feature! {
66+
#![feature = "unix-sock-client"]
67+
#[cfg(unix)]
68+
mod unix_sock_client;
69+
#[cfg(unix)]
70+
pub use unix_sock_client::*;
71+
}
6972

7073
type HyperRequest = hyper::Request<ReqBody>;
7174
type HyperResponse = hyper::Response<ResBody>;

0 commit comments

Comments
 (0)