Update dependencies and fix nightly warnings.

This commit is contained in:
Sergio Benitez 2024-04-11 18:09:21 -07:00
parent 17eca5bcc6
commit dcde224648
6 changed files with 32 additions and 26 deletions

View File

@ -13,4 +13,4 @@ harness = false
[dev-dependencies] [dev-dependencies]
rocket = { path = "../core/lib/" } rocket = { path = "../core/lib/" }
criterion = "0.4" criterion = "0.5.1"

View File

@ -217,6 +217,9 @@ fn internal_uri_macro_decl(route: &Route) -> TokenStream {
let route_uri = route.attr.uri.to_string(); let route_uri = route.attr.uri.to_string();
quote_spanned! { Span::call_site() => quote_spanned! { Span::call_site() =>
#[doc(hidden)]
#[allow(nonstandard_style, unused)]
pub mod #inner_macro_name {
#[doc(hidden)] #[doc(hidden)]
#[macro_export] #[macro_export]
/// Rocket generated URI macro. /// Rocket generated URI macro.
@ -226,9 +229,12 @@ fn internal_uri_macro_decl(route: &Route) -> TokenStream {
}}; }};
} }
pub use #inner_macro_name as #macro_name;
}
#[doc(hidden)] #[doc(hidden)]
#[allow(unused)] #[allow(unused)]
pub use #inner_macro_name as #macro_name; pub use #inner_macro_name::#macro_name;
} }
} }

View File

@ -61,14 +61,14 @@ fn extract_exprs(internal: &InternalUriParams) -> Result<(
let types = internal.fn_args.iter().map(|a| (&a.ident, &a.ty)); let types = internal.fn_args.iter().map(|a| (&a.ident, &a.ty));
Ok((path_exprs, query_exprs, types)) Ok((path_exprs, query_exprs, types))
} }
Validation::NamedIgnored(_) => { Validation::NamedIgnored(args) => {
let mut route_name = quote!(#route_name).to_string(); let mut route_name = quote!(#route_name).to_string();
route_name.retain(|c| !c.is_whitespace()); route_name.retain(|c| !c.is_whitespace());
let diag = internal.uri_mac.args_span() let diag = internal.uri_mac.args_span()
.error("expected unnamed arguments due to ignored parameters") .error("expected unnamed arguments due to ignored parameters")
.note(format!("uri for route `{}` ignores path parameters: \"{}\"", .note(format!("uri for route `{}` ignores {} path parameters: \"{}\"",
route_name, internal.route_uri)); route_name, args.len(), internal.route_uri));
Err(diag) Err(diag)
} }

View File

@ -123,7 +123,7 @@ version = "2.1.0"
optional = true optional = true
[dependencies.s2n-quic] [dependencies.s2n-quic]
version = "1.32" version = "1.36"
default-features = false default-features = false
features = ["provider-address-token-default", "provider-tls-rustls"] features = ["provider-address-token-default", "provider-tls-rustls"]
optional = true optional = true

View File

@ -732,9 +732,7 @@ impl<S, E, F> Outcome<S, E, F> {
pub(crate) struct Display<'a, 'r>(&'a route::Outcome<'r>); pub(crate) struct Display<'a, 'r>(&'a route::Outcome<'r>);
impl<'r> route::Outcome<'r> { impl fmt::Display for Display<'_, '_> {
pub(crate) fn log_display(&self) -> Display<'_, 'r> {
impl fmt::Display for Display<'_, '_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", "Outcome: ".primary().bold())?; write!(f, "{}", "Outcome: ".primary().bold())?;
@ -745,8 +743,10 @@ impl<'r> route::Outcome<'r> {
Forward((_, s)) => write!(f, "{}({})", "Forward".paint(color), s.primary()), Forward((_, s)) => write!(f, "{}({})", "Forward".paint(color), s.primary()),
} }
} }
} }
impl<'r> route::Outcome<'r> {
pub(crate) fn log_display(&self) -> Display<'_, 'r> {
Display(self) Display(self)
} }
} }

View File

@ -7,4 +7,4 @@ publish = false
[dependencies] [dependencies]
rocket = { path = "../../core/lib" } rocket = { path = "../../core/lib" }
flume = "0.10" flume = "0.11"