Remove take_* methods from RequestParts for Version, Method, and Uri (#151)

* Remove `RequestParts::take_method`

* Remove `RequestParts::take_uri`

* Remove `RequestParts::take_version`
This commit is contained in:
David Pedersen
2021-08-07 20:24:13 +02:00
committed by GitHub
parent 75b5615ccd
commit 4bb17cbc2d
8 changed files with 51 additions and 116 deletions
-24
View File
@@ -10,27 +10,6 @@ use http_body::Full;
use std::convert::Infallible;
use tower::BoxError;
define_rejection! {
#[status = INTERNAL_SERVER_ERROR]
#[body = "Version taken by other extractor"]
/// Rejection used if the HTTP version has been taken by another extractor.
pub struct VersionAlreadyExtracted;
}
define_rejection! {
#[status = INTERNAL_SERVER_ERROR]
#[body = "URI taken by other extractor"]
/// Rejection used if the URI has been taken by another extractor.
pub struct UriAlreadyExtracted;
}
define_rejection! {
#[status = INTERNAL_SERVER_ERROR]
#[body = "Method taken by other extractor"]
/// Rejection used if the method has been taken by another extractor.
pub struct MethodAlreadyExtracted;
}
define_rejection! {
#[status = INTERNAL_SERVER_ERROR]
#[body = "Extensions taken by other extractor"]
@@ -222,7 +201,6 @@ composite_rejection! {
/// Contains one variant for each way the [`Query`](super::Query) extractor
/// can fail.
pub enum QueryRejection {
UriAlreadyExtracted,
FailedToDeserializeQueryString,
}
}
@@ -237,9 +215,7 @@ composite_rejection! {
FailedToDeserializeQueryString,
FailedToBufferBody,
BodyAlreadyExtracted,
UriAlreadyExtracted,
HeadersAlreadyExtracted,
MethodAlreadyExtracted,
}
}