Skip to content

Commit

Permalink
[1]
Browse files Browse the repository at this point in the history
  • Loading branch information
raul-gherman committed Sep 7, 2024
1 parent 2db2392 commit 2d295c6
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 466 deletions.
8 changes: 0 additions & 8 deletions kaminari/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ pub trait AsyncConnect<S: IOStream> {
fn connect<'a>(&'a self, stream: S, buf: &'a mut [u8]) -> Self::ConnectFut<'a>;
}

pub trait AsyncAccept<S: IOStream> {
type Stream: IOStream;
type AcceptFut<'a>: Future<Output = Result<Self::Stream>>
where
Self: 'a;
fn accept<'a>(&'a self, stream: S, buf: &'a mut [u8]) -> Self::AcceptFut<'a>;
}

pub mod nop;
pub mod opt;
pub mod trick;
Expand Down
13 changes: 1 addition & 12 deletions kaminari/src/nop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::io::Result;
use std::future::Future;
use std::fmt::{Display, Formatter};

use super::{IOStream, AsyncAccept, AsyncConnect};
use super::{IOStream, AsyncConnect};

#[derive(Debug, Clone, Copy)]
pub struct NopConnect {}
Expand All @@ -28,14 +28,3 @@ where

fn connect(&self, stream: S, _: &mut [u8]) -> Self::ConnectFut<'_> { async move { Ok(stream) } }
}

impl<S> AsyncAccept<S> for NopAccept
where
S: IOStream,
{
type Stream = S;

type AcceptFut<'a> = impl Future<Output = Result<Self::Stream>> where Self:'a;

fn accept(&self, stream: S, _: &mut [u8]) -> Self::AcceptFut<'_> { async move { Ok(stream) } }
}
2 changes: 1 addition & 1 deletion kaminari/src/opt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use super::ws::WsConf;

#[cfg(feature = "tls")]
use super::tls::{TlsClientConf, TlsServerConf};
use super::tls::TlsClientConf;

#[macro_export]
macro_rules! has_opt {
Expand Down
Loading

0 comments on commit 2d295c6

Please sign in to comment.