mirror of
https://github.com/ntex-rs/ntex.git
synced 2025-04-01 20:07:39 +03:00
Clippy (#499)
This commit is contained in:
parent
44fcfd62ff
commit
cd56883197
3 changed files with 3 additions and 3 deletions
|
@ -256,7 +256,7 @@ pub trait ServiceFactory<Req, Cfg = ()> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, S, Req> Service<Req> for &'a S
|
impl<S, Req> Service<Req> for &S
|
||||||
where
|
where
|
||||||
S: Service<Req>,
|
S: Service<Req>,
|
||||||
{
|
{
|
||||||
|
|
|
@ -143,7 +143,7 @@ impl<Err: ErrorRenderer> Responder<Err> for String {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, Err: ErrorRenderer> Responder<Err> for &'a String {
|
impl<Err: ErrorRenderer> Responder<Err> for &String {
|
||||||
async fn respond_to(self, _: &HttpRequest) -> Response {
|
async fn respond_to(self, _: &HttpRequest) -> Response {
|
||||||
Response::build(StatusCode::OK)
|
Response::build(StatusCode::OK)
|
||||||
.content_type("text/plain; charset=utf-8")
|
.content_type("text/plain; charset=utf-8")
|
||||||
|
|
|
@ -294,7 +294,7 @@ where
|
||||||
let json = if let Ok(Some(mime)) = req.mime_type() {
|
let json = if let Ok(Some(mime)) = req.mime_type() {
|
||||||
mime.subtype() == mime::JSON
|
mime.subtype() == mime::JSON
|
||||||
|| mime.suffix() == Some(mime::JSON)
|
|| mime.suffix() == Some(mime::JSON)
|
||||||
|| ctype.as_ref().map_or(false, |predicate| predicate(mime))
|
|| ctype.as_ref().is_some_and(|predicate| predicate(mime))
|
||||||
} else {
|
} else {
|
||||||
false
|
false
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue