diff --git a/CHANGES.md b/CHANGES.md index bc022e38..d56e5ce0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,10 @@ * Re-implement Host predicate (#989) +### Changed + +* `Query` payload made `pub`. Allows user to pattern-match the payload. + ## [1.0.5] - 2019-07-18 diff --git a/src/types/query.rs b/src/types/query.rs index 2ad7106d..d00f4600 100644 --- a/src/types/query.rs +++ b/src/types/query.rs @@ -36,7 +36,7 @@ use crate::request::HttpRequest; /// // Use `Query` extractor for query information. /// // This handler get called only if request's query contains `username` field /// // The correct request for this handler would be `/index.html?id=64&response_type=Code"` -/// fn index(info: web::Query) -> String { +/// fn index(web::Query(info): web::Query) -> String { /// format!("Authorization request for client with id={} and type={:?}!", info.id, info.response_type) /// } /// @@ -45,7 +45,7 @@ use crate::request::HttpRequest; /// web::resource("/index.html").route(web::get().to(index))); // <- use `Query` extractor /// } /// ``` -pub struct Query(T); +pub struct Query(pub T); impl Query { /// Deconstruct to a inner value