clippy warnings

This commit is contained in:
Nikolay Kim 2021-02-18 19:26:03 +06:00
parent 96ca5c3542
commit f2c51a0fa1
4 changed files with 16 additions and 16 deletions

View file

@ -31,18 +31,18 @@ pub(crate) enum PrepForSendingError {
Http(HttpError),
}
impl Into<FreezeRequestError> for PrepForSendingError {
fn into(self) -> FreezeRequestError {
match self {
impl From<PrepForSendingError> for FreezeRequestError {
fn from(err: PrepForSendingError) -> FreezeRequestError {
match err {
PrepForSendingError::Url(e) => FreezeRequestError::Url(e),
PrepForSendingError::Http(e) => FreezeRequestError::Http(e),
}
}
}
impl Into<SendRequestError> for PrepForSendingError {
fn into(self) -> SendRequestError {
match self {
impl From<PrepForSendingError> for SendRequestError {
fn from(err: PrepForSendingError) -> SendRequestError {
match err {
PrepForSendingError::Url(e) => SendRequestError::Url(e),
PrepForSendingError::Http(e) => SendRequestError::Http(e),
}

View file

@ -125,9 +125,9 @@ impl WebResponse {
}
}
impl Into<Response<Body>> for WebResponse {
fn into(self) -> Response<Body> {
self.response
impl From<WebResponse> for Response<Body> {
fn from(res: WebResponse) -> Response<Body> {
res.response
}
}

View file

@ -156,7 +156,7 @@ impl<Err: ErrorRenderer> FromRequest<Err> for Bytes {
let limit = cfg.limit;
let fut = HttpMessageBody::new(req, payload).limit(limit);
Either::Left(async move { Ok(fut.await?) }.boxed_local())
Either::Left(async move { fut.await }.boxed_local())
}
}

View file

@ -35,9 +35,9 @@ impl fmt::Display for OpCode {
}
}
impl Into<u8> for OpCode {
fn into(self) -> u8 {
match self {
impl From<OpCode> for u8 {
fn from(code: OpCode) -> u8 {
match code {
Continue => 0,
Text => 1,
Binary => 2,
@ -132,9 +132,9 @@ pub enum CloseCode {
Other(u16),
}
impl Into<u16> for CloseCode {
fn into(self) -> u16 {
match self {
impl From<CloseCode> for u16 {
fn from(code: CloseCode) -> u16 {
match code {
Normal => 1000,
Away => 1001,
Protocol => 1002,