Remove unused code (#44)

* remove unused #[macro_use] and #[allow(unused_macros)]

* remove unused FnBox trait

* remove unused temporary variable

* remove Evented trait requirement to implement Debug
This commit is contained in:
Thomas de Zeeuw 2017-12-01 22:34:03 +01:00 committed by Alex Crichton
parent 31f8cb9467
commit 0b54557796
5 changed files with 2 additions and 16 deletions

View File

@ -11,7 +11,6 @@
//! Each line you type in to the `nc` terminal should be echo'd back to you!
extern crate futures;
#[macro_use]
extern crate tokio;
#[macro_use]
extern crate tokio_io;

View File

@ -86,7 +86,6 @@
#![doc(html_root_url = "https://docs.rs/tokio-core/0.1")]
#![deny(missing_docs)]
#![deny(warnings)]
#![allow(unused_macros)]
extern crate bytes;
#[macro_use]

View File

@ -360,16 +360,6 @@ impl Notify for MySetReadiness {
}
}
trait FnBox: Send + 'static {
fn call_box(self: Box<Self>, lp: &Core);
}
impl<F: FnOnce(&Core) + Send + 'static> FnBox for F {
fn call_box(self: Box<Self>, lp: &Core) {
(*self)(lp)
}
}
fn read_ready() -> mio::Ready {
mio::Ready::readable() | platform::hup()
}

View File

@ -69,7 +69,7 @@ pub struct PollEvented<E> {
io: E,
}
impl<E: Evented + fmt::Debug> fmt::Debug for PollEvented<E> {
impl<E: fmt::Debug> fmt::Debug for PollEvented<E> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("PollEvented")
.field("io", &self.io)
@ -111,8 +111,7 @@ impl<E: Evented> PollEvented<E> {
None => return Ok(()),
};
let ret = inner.deregister_source(&self.io);
return ret
inner.deregister_source(&self.io)
}
}

View File

@ -1,5 +1,4 @@
extern crate futures;
#[macro_use]
extern crate tokio;
#[macro_use]
extern crate tokio_io;