Fix clippy lints and enable clippy checking in CI

This commit is contained in:
Kirill Bulatov
2021-09-15 09:04:33 +03:00
parent 8de41f1d70
commit 7dda9f2894
17 changed files with 39 additions and 39 deletions

View File

@@ -1,7 +1,6 @@
use anyhow::anyhow;
use hyper::{header, Body, Response, StatusCode};
use serde::{Deserialize, Serialize};
use serde_json;
use thiserror::Error;
#[derive(Debug, Error)]
@@ -56,10 +55,10 @@ impl HttpErrorBody {
}
pub fn response_from_msg_and_status(msg: String, status: StatusCode) -> Response<Body> {
HttpErrorBody { msg }.into_response(status)
HttpErrorBody { msg }.to_response(status)
}
pub fn into_response(&self, status: StatusCode) -> Response<Body> {
pub fn to_response(&self, status: StatusCode) -> Response<Body> {
Response::builder()
.status(status)
.header(header::CONTENT_TYPE, "application/json")

View File

@@ -1,7 +1,6 @@
use bytes::Buf;
use hyper::{header, Body, Request, Response, StatusCode};
use serde::{Deserialize, Serialize};
use serde_json;
use super::error::ApiError;