Compare commits

..

No commits in common. "c4be19942b2c2e41813242f1b42b2fa908ef991f" and "819ee93e9b81c2f4a71ea637df1125682704a0e7" have entirely different histories.

5 changed files with 4 additions and 12 deletions

View File

@ -2,7 +2,6 @@
## Unreleased ## Unreleased
- Add `resources-introspection` feature for retrieving configured route paths and HTTP methods.
- Implement `Responder` for `Result<(), E: Into<Error>>`. Returning `Ok(())` responds with HTTP 204 No Content. - Implement `Responder` for `Result<(), E: Into<Error>>`. Returning `Ok(())` responds with HTTP 204 No Content.
- On Windows, an error is now returned from `HttpServer::bind()` (or TLS variants) when binding to a socket that's already in use. - On Windows, an error is now returned from `HttpServer::bind()` (or TLS variants) when binding to a socket that's already in use.
- Update `brotli` dependency to `7`. - Update `brotli` dependency to `7`.

View File

@ -11,7 +11,7 @@
//! or handler. This interface is defined by the [`Guard`] trait. //! or handler. This interface is defined by the [`Guard`] trait.
//! //!
//! Commonly-used guards are provided in this module as well as a way of creating a guard from a //! Commonly-used guards are provided in this module as well as a way of creating a guard from a
//! closure ([`fn_guard`]). The [`Not`], [`Any()`], and [`All`] guards are noteworthy, as they can be //! closure ([`fn_guard`]). The [`Not`], [`Any`], and [`All`] guards are noteworthy, as they can be
//! used to compose other guards in a more flexible and semantic way than calling `.guard(...)` on //! used to compose other guards in a more flexible and semantic way than calling `.guard(...)` on
//! services multiple times (which might have different combining behavior than you want). //! services multiple times (which might have different combining behavior than you want).
//! //!
@ -196,7 +196,7 @@ pub fn Any<F: Guard + 'static>(guard: F) -> AnyGuard {
/// ///
/// That is, only one contained guard needs to match in order for the aggregate guard to match. /// That is, only one contained guard needs to match in order for the aggregate guard to match.
/// ///
/// Construct an `AnyGuard` using [`Any()`]. /// Construct an `AnyGuard` using [`Any`].
pub struct AnyGuard { pub struct AnyGuard {
guards: Vec<Box<dyn Guard>>, guards: Vec<Box<dyn Guard>>,
} }

View File

@ -442,8 +442,8 @@ where
{ {
rmap.add(&mut rdef, None); rmap.add(&mut rdef, None);
self.routes.iter().for_each(|r| { self.routes.iter_mut().for_each(|r| {
r.get_guards().iter().for_each(|g| { r.take_guards().iter().for_each(|g| {
let http_methods: Vec<String> = let http_methods: Vec<String> =
crate::guard::HttpMethodsExtractor::extract_http_methods(&**g); crate::guard::HttpMethodsExtractor::extract_http_methods(&**g);
rdef_methods rdef_methods

View File

@ -65,11 +65,6 @@ impl Route {
pub(crate) fn take_guards(&mut self) -> Vec<Box<dyn Guard>> { pub(crate) fn take_guards(&mut self) -> Vec<Box<dyn Guard>> {
mem::take(Rc::get_mut(&mut self.guards).unwrap()) mem::take(Rc::get_mut(&mut self.guards).unwrap())
} }
#[cfg(feature = "resources-introspection")]
pub(crate) fn get_guards(&self) -> &Vec<Box<dyn Guard>> {
&self.guards
}
} }
impl ServiceFactory<ServiceRequest> for Route { impl ServiceFactory<ServiceRequest> for Route {

View File

@ -13,8 +13,6 @@ downgrade-for-msrv:
cargo update -p=parse-size --precise=1.0.0 cargo update -p=parse-size --precise=1.0.0
cargo update -p=clap --precise=4.4.18 cargo update -p=clap --precise=4.4.18
cargo update -p=divan --precise=0.1.15 cargo update -p=divan --precise=0.1.15
cargo update -p=litemap --precise=0.7.4
cargo update -p=zerofrom --precise=0.1.5
msrv := ``` msrv := ```
cargo metadata --format-version=1 \ cargo metadata --format-version=1 \