1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-08-31 10:46:58 +02:00

Replace derive_more with declarative macros (#438)

Co-authored-by: Rob Ede <robjtede@icloud.com>
This commit is contained in:
Ibraheem Ahmed
2022-01-28 17:09:33 -05:00
committed by GitHub
parent b7b7bd2cbf
commit 26446fdbad
10 changed files with 114 additions and 33 deletions

View File

@@ -1,17 +1,16 @@
use derive_more::{Deref, DerefMut};
use super::Host;
use crate::impl_more;
/// Wraps underlying I/O and the connection request that initiated it.
#[derive(Debug, Deref, DerefMut)]
#[derive(Debug)]
pub struct Connection<R, IO> {
pub(crate) req: R,
#[deref]
#[deref_mut]
pub(crate) io: IO,
}
impl_more::deref! { Connection<R, IO> => io: IO }
impl_more::deref_mut! { Connection<R, IO> => io }
impl<R, IO> Connection<R, IO> {
/// Construct new `Connection` from request and IO parts.
pub(crate) fn new(req: R, io: IO) -> Self {