diff --git a/contrib/lib/src/templates/fairing.rs b/contrib/lib/src/templates/fairing.rs index 71e138f191..f09d01d91e 100644 --- a/contrib/lib/src/templates/fairing.rs +++ b/contrib/lib/src/templates/fairing.rs @@ -123,7 +123,7 @@ pub struct TemplateFairing { /// The user-provided customization callback, allowing the use of /// functionality specific to individual template engines. In debug mode, /// this callback might be run multiple times as templates are reloaded. - crate custom_callback: Box, + crate custom_callback: Box, } impl Fairing for TemplateFairing { diff --git a/core/http/src/parse/checkers.rs b/core/http/src/parse/checkers.rs index 2658552995..ae9d21ed8e 100644 --- a/core/http/src/parse/checkers.rs +++ b/core/http/src/parse/checkers.rs @@ -6,7 +6,7 @@ pub fn is_whitespace(byte: char) -> bool { #[inline] pub fn is_valid_token(c: char) -> bool { match c { - '0'...'9' | 'A'...'Z' | '^'...'~' | '#'...'\'' + '0'..='9' | 'A'..='Z' | '^'..='~' | '#'..='\'' | '!' | '*' | '+' | '-' | '.' => true, _ => false } diff --git a/core/http/src/uri/uri_display.rs b/core/http/src/uri/uri_display.rs index fb81939f04..1c97a66a76 100644 --- a/core/http/src/uri/uri_display.rs +++ b/core/http/src/uri/uri_display.rs @@ -294,7 +294,7 @@ pub trait UriDisplay { fn fmt(&self, f: &mut Formatter

) -> fmt::Result; } -impl<'a, P: UriPart> fmt::Display for &'a UriDisplay

{ +impl<'a, P: UriPart> fmt::Display for &'a dyn UriDisplay

{ #[inline(always)] fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { UriDisplay::fmt(*self, &mut >::new(f)) diff --git a/core/lib/src/config/toml_ext.rs b/core/lib/src/config/toml_ext.rs index bf5a61998e..42a8b25bac 100644 --- a/core/lib/src/config/toml_ext.rs +++ b/core/lib/src/config/toml_ext.rs @@ -24,7 +24,7 @@ fn is_not_separator(byte: char) -> bool { #[inline(always)] fn is_ident_char(byte: char) -> bool { match byte { - '0'...'9' | 'A'...'Z' | 'a'...'z' | '_' | '-' => true, + '0'..='9' | 'A'..='Z' | 'a'..='z' | '_' | '-' => true, _ => false } } diff --git a/core/lib/src/data/data.rs b/core/lib/src/data/data.rs index e755395ed7..35ee3e8031 100644 --- a/core/lib/src/data/data.rs +++ b/core/lib/src/data/data.rs @@ -15,7 +15,7 @@ use http::hyper::h1::HttpReader::*; use http::hyper::net::{HttpStream, NetworkStream}; pub type HyperBodyReader<'a, 'b> = - self::HttpReader<&'a mut hyper::buffer::BufReader<&'b mut NetworkStream>>; + self::HttpReader<&'a mut hyper::buffer::BufReader<&'b mut dyn NetworkStream>>; // |---- from hyper ----| pub type BodyReader = HttpReader>, NetStream>>; @@ -94,7 +94,7 @@ impl Data { crate fn from_hyp(mut body: HyperBodyReader) -> Result { #[inline(always)] #[cfg(feature = "tls")] - fn concrete_stream(stream: &mut NetworkStream) -> Option { + fn concrete_stream(stream: &mut dyn NetworkStream) -> Option { stream.downcast_ref::() .map(|s| NetStream::Https(s.clone())) .or_else(|| { diff --git a/core/lib/src/fairing/fairings.rs b/core/lib/src/fairing/fairings.rs index 93815f9c90..e7b40c39d4 100644 --- a/core/lib/src/fairing/fairings.rs +++ b/core/lib/src/fairing/fairings.rs @@ -5,7 +5,7 @@ use yansi::Paint; #[derive(Default)] pub struct Fairings { - all_fairings: Vec>, + all_fairings: Vec>, attach_failures: Vec<&'static str>, // The vectors below hold indices into `all_fairings`. launch: Vec, @@ -19,7 +19,7 @@ impl Fairings { Fairings::default() } - pub fn attach(&mut self, fairing: Box, mut rocket: Rocket) -> Rocket { + pub fn attach(&mut self, fairing: Box, mut rocket: Rocket) -> Rocket { // Run the `on_attach` callback if this is an 'attach' fairing. let kind = fairing.info().kind; let name = fairing.info().name; @@ -32,7 +32,7 @@ impl Fairings { rocket } - fn add(&mut self, fairing: Box) { + fn add(&mut self, fairing: Box) { let kind = fairing.info().kind; if !kind.is_exactly(Kind::Attach) { let index = self.all_fairings.len(); diff --git a/core/lib/src/handler.rs b/core/lib/src/handler.rs index 33b930046c..a11f8f3b71 100644 --- a/core/lib/src/handler.rs +++ b/core/lib/src/handler.rs @@ -152,19 +152,19 @@ pub trait Handler: Cloneable + Send + Sync + 'static { /// `Handler` automatically implement `Cloneable`. pub trait Cloneable { /// Clones `self`. - fn clone_handler(&self) -> Box; + fn clone_handler(&self) -> Box; } impl Cloneable for T { #[inline(always)] - fn clone_handler(&self) -> Box { + fn clone_handler(&self) -> Box { Box::new(self.clone()) } } -impl Clone for Box { +impl Clone for Box { #[inline(always)] - fn clone(&self) -> Box { + fn clone(&self) -> Box { self.clone_handler() } } diff --git a/core/lib/src/response/response.rs b/core/lib/src/response/response.rs index bb081e6e3f..d09cc84aec 100644 --- a/core/lib/src/response/response.rs +++ b/core/lib/src/response/response.rs @@ -560,7 +560,7 @@ impl<'r> ResponseBuilder<'r> { pub struct Response<'r> { status: Option, headers: HeaderMap<'r>, - body: Option>>, + body: Option>>, } impl<'r> Response<'r> { @@ -889,7 +889,7 @@ impl<'r> Response<'r> { /// assert_eq!(response.body_string(), Some("Hello, world!".to_string())); /// ``` #[inline(always)] - pub fn body(&mut self) -> Option> { + pub fn body(&mut self) -> Option> { // Looks crazy, right? Needed so Rust infers lifetime correctly. Weird. match self.body.as_mut() { Some(body) => Some(match body.as_mut() { @@ -966,7 +966,7 @@ impl<'r> Response<'r> { /// assert!(response.body().is_none()); /// ``` #[inline(always)] - pub fn take_body(&mut self) -> Option>> { + pub fn take_body(&mut self) -> Option>> { self.body.take() } diff --git a/core/lib/src/router/route.rs b/core/lib/src/router/route.rs index 4856afdc42..b41d3a63af 100644 --- a/core/lib/src/router/route.rs +++ b/core/lib/src/router/route.rs @@ -19,7 +19,7 @@ pub struct Route { /// The method this route matches against. pub method: Method, /// The function that should be called when the route matches. - pub handler: Box, + pub handler: Box, /// The base mount point of this `Route`. pub base: Origin<'static>, /// The uri (in Rocket's route format) that should be matched against. This diff --git a/examples/handlebars_templates/src/main.rs b/examples/handlebars_templates/src/main.rs index 759674d63c..7e51502aba 100644 --- a/examples/handlebars_templates/src/main.rs +++ b/examples/handlebars_templates/src/main.rs @@ -58,7 +58,7 @@ fn wow_helper( _: &Handlebars, _: &Context, _: &mut RenderContext, - out: &mut Output + out: &mut dyn Output ) -> HelperResult { if let Some(param) = h.param(0) { out.write("")?;