mirror of
https://github.com/fafhrd91/actix-net
synced 2025-06-28 05:10:36 +02:00
clippy warnings
This commit is contained in:
@ -1,5 +1,9 @@
|
||||
# Changes
|
||||
|
||||
## [0.3.0-alpha.2] - 2019-12-02
|
||||
|
||||
* Migrate to `std::future`
|
||||
|
||||
|
||||
## [0.1.1] - 2019-10-14
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "actix-ioframe"
|
||||
version = "0.3.0-alpha.1"
|
||||
version = "0.3.0-alpha.2"
|
||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
||||
description = "Actix framed service"
|
||||
keywords = ["network", "framework", "async", "futures"]
|
||||
@ -18,16 +18,16 @@ name = "actix_ioframe"
|
||||
path = "src/lib.rs"
|
||||
|
||||
[dependencies]
|
||||
actix-service = "1.0.0-alpha.1"
|
||||
actix-codec = "0.2.0-alpha.1"
|
||||
actix-utils = "0.5.0-alpha.1"
|
||||
actix-rt = "1.0.0-alpha.1"
|
||||
actix-service = "1.0.0-alpha.2"
|
||||
actix-codec = "0.2.0-alpha.2"
|
||||
actix-utils = "1.0.0-alpha.2"
|
||||
actix-rt = "1.0.0-alpha.2"
|
||||
bytes = "0.4"
|
||||
either = "1.5.2"
|
||||
futures = "0.3.1"
|
||||
pin-project = "0.4.5"
|
||||
pin-project = "0.4.6"
|
||||
log = "0.4"
|
||||
|
||||
[dev-dependencies]
|
||||
actix-connect = "1.0.0-alpha.1"
|
||||
actix-testing = "0.3.0-alpha.1"
|
||||
actix-connect = "1.0.0-alpha.2"
|
||||
actix-testing = "1.0.0-alpha.2"
|
||||
|
@ -17,7 +17,7 @@ impl<T> Clone for Cell<T> {
|
||||
}
|
||||
|
||||
impl<T: fmt::Debug> fmt::Debug for Cell<T> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
self.inner.fmt(f)
|
||||
}
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ where
|
||||
{
|
||||
type Item = Result<<Codec as Decoder>::Item, <Codec as Decoder>::Error>;
|
||||
|
||||
fn poll_next(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Option<Self::Item>> {
|
||||
fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
|
||||
self.project().framed.next_item(cx)
|
||||
}
|
||||
}
|
||||
@ -95,7 +95,7 @@ where
|
||||
{
|
||||
type Error = <Codec as Encoder>::Error;
|
||||
|
||||
fn poll_ready(self: Pin<&mut Self>, _: &mut Context) -> Poll<Result<(), Self::Error>> {
|
||||
fn poll_ready(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
|
||||
if self.framed.is_ready() {
|
||||
Poll::Ready(Ok(()))
|
||||
} else {
|
||||
|
@ -136,7 +136,7 @@ where
|
||||
{
|
||||
pub(crate) fn poll(
|
||||
&mut self,
|
||||
cx: &mut Context,
|
||||
cx: &mut Context<'_>,
|
||||
) -> Poll<Result<(), ServiceError<S::Error, U>>> {
|
||||
let this = self;
|
||||
unsafe { this.inner.get_ref().task.register(cx.waker()) };
|
||||
@ -156,7 +156,7 @@ where
|
||||
}
|
||||
|
||||
fn poll<St, S, T, U>(
|
||||
cx: &mut Context,
|
||||
cx: &mut Context<'_>,
|
||||
srv: &mut S,
|
||||
state: &mut St,
|
||||
sink: &mut Sink<<U as Encoder>::Item>,
|
||||
@ -247,7 +247,7 @@ where
|
||||
}
|
||||
|
||||
fn poll_read<St, S, T, U>(
|
||||
cx: &mut Context,
|
||||
cx: &mut Context<'_>,
|
||||
srv: &mut S,
|
||||
state: &mut St,
|
||||
sink: &mut Sink<<U as Encoder>::Item>,
|
||||
@ -310,7 +310,7 @@ where
|
||||
|
||||
/// write to framed object
|
||||
fn poll_write<St, S, T, U>(
|
||||
cx: &mut Context,
|
||||
cx: &mut Context<'_>,
|
||||
framed: &mut Framed<T, U>,
|
||||
dispatch_state: &mut FramedState<S, U>,
|
||||
rx: &mut Option<mpsc::Receiver<FramedMessage<<U as Encoder>::Item>>>,
|
||||
|
@ -24,7 +24,7 @@ where
|
||||
<U as Encoder>::Error: fmt::Debug,
|
||||
<U as Decoder>::Error: fmt::Debug,
|
||||
{
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match *self {
|
||||
ServiceError::Service(ref e) => write!(fmt, "ServiceError::Service({:?})", e),
|
||||
ServiceError::Encoder(ref e) => write!(fmt, "ServiceError::Encoder({:?})", e),
|
||||
@ -39,7 +39,7 @@ where
|
||||
<U as Encoder>::Error: fmt::Debug,
|
||||
<U as Decoder>::Error: fmt::Debug,
|
||||
{
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match *self {
|
||||
ServiceError::Service(ref e) => write!(fmt, "{}", e),
|
||||
ServiceError::Encoder(ref e) => write!(fmt, "{:?}", e),
|
||||
|
@ -76,7 +76,7 @@ where
|
||||
Codec: Encoder + Decoder,
|
||||
<Codec as Decoder>::Item: fmt::Debug,
|
||||
{
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_tuple("FramedItem").field(&self.item).finish()
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,6 @@
|
||||
#![deny(rust_2018_idioms, warnings)]
|
||||
#![allow(clippy::type_complexity, clippy::too_many_arguments)]
|
||||
|
||||
mod cell;
|
||||
mod connect;
|
||||
mod dispatcher;
|
||||
|
@ -22,6 +22,12 @@ type ResponseItem<U> = Option<<U as Encoder>::Item>;
|
||||
/// for building instances for framed services.
|
||||
pub struct Builder<St, Codec>(PhantomData<(St, Codec)>);
|
||||
|
||||
impl<St: Clone, Codec> Default for Builder<St, Codec> {
|
||||
fn default() -> Builder<St, Codec> {
|
||||
Builder::new()
|
||||
}
|
||||
}
|
||||
|
||||
impl<St: Clone, Codec> Builder<St, Codec> {
|
||||
pub fn new() -> Builder<St, Codec> {
|
||||
Builder(PhantomData)
|
||||
@ -251,7 +257,7 @@ where
|
||||
type Error = ServiceError<C::Error, Codec>;
|
||||
type Future = FramedServiceImplResponse<St, Io, Codec, C, T>;
|
||||
|
||||
fn poll_ready(&mut self, cx: &mut Context) -> Poll<Result<(), Self::Error>> {
|
||||
fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
|
||||
self.connect.poll_ready(cx).map_err(|e| e.into())
|
||||
}
|
||||
|
||||
@ -309,7 +315,7 @@ where
|
||||
{
|
||||
type Output = Result<(), ServiceError<C::Error, Codec>>;
|
||||
|
||||
fn poll(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll<Self::Output> {
|
||||
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
|
||||
let mut this = self.as_mut().project();
|
||||
|
||||
loop {
|
||||
@ -373,7 +379,7 @@ where
|
||||
#[project]
|
||||
fn poll(
|
||||
self: Pin<&mut Self>,
|
||||
cx: &mut Context,
|
||||
cx: &mut Context<'_>,
|
||||
) -> Either<
|
||||
FramedServiceImplResponseInner<St, Io, Codec, C, T>,
|
||||
Poll<Result<(), ServiceError<C::Error, Codec>>>,
|
||||
|
@ -38,7 +38,7 @@ impl<T> Sink<T> {
|
||||
}
|
||||
|
||||
impl<T> fmt::Debug for Sink<T> {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
fmt.debug_struct("Sink").finish()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user