remove some useless stuff

This commit is contained in:
Omid Rad 2021-07-13 00:55:40 +02:00
parent eced22d546
commit 39e2aa39f8
1 changed files with 2 additions and 5 deletions

View File

@ -357,8 +357,7 @@ mod tests {
.finish() .finish()
} }
async fn test(req: HttpRequest, bytes: Bytes) -> HttpResponse { async fn test(req: HttpRequest, body: Bytes) -> HttpResponse {
let body = String::from_utf8(bytes.to_vec()).unwrap();
if req.method() == Method::POST && !body.is_empty() { if req.method() == Method::POST && !body.is_empty() {
HttpResponse::Ok().finish() HttpResponse::Ok().finish()
} else { } else {
@ -385,9 +384,7 @@ mod tests {
.finish() .finish()
} }
async fn test(req: HttpRequest, bytes: Bytes) -> HttpResponse { async fn test(req: HttpRequest, body: Bytes) -> HttpResponse {
let body = String::from_utf8(bytes.to_vec()).unwrap();
if (req.method() == Method::GET || req.method() == Method::HEAD) if (req.method() == Method::GET || req.method() == Method::HEAD)
&& body.is_empty() && body.is_empty()
{ {