diff --git a/Cargo.toml b/Cargo.toml index 14847b4..0f004c0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,6 @@ tokio = { version = "0.3.1", features = ["io-util","net","time", "rt"] } mime = "0.3.16" uriparse = "0.6.3" percent-encoding = "2.1.0" -futures-core = "0.3.7" log = "0.4.11" webpki = "0.21.0" lazy_static = "1.4.0" diff --git a/src/lib.rs b/src/lib.rs index 7f7f4d6..b2f97a8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,8 +7,9 @@ use std::{ sync::Arc, path::PathBuf, time::Duration, + pin::Pin, }; -use futures_core::future::{BoxFuture, Future}; +use std::future::Future; use tokio::{ prelude::*, io::{self, BufStream}, @@ -36,7 +37,7 @@ pub const REQUEST_URI_MAX_LEN: usize = 1024; pub const GEMINI_PORT: u16 = 1965; pub (crate) type Handler = Arc HandlerResponse + Send + Sync>; -pub (crate) type HandlerResponse = BoxFuture<'static, Result>; +pub (crate) type HandlerResponse = Pin> + Send>>; #[derive(Clone)] pub struct Server { diff --git a/src/util.rs b/src/util.rs index 5c623aa..33ca6d6 100644 --- a/src/util.rs +++ b/src/util.rs @@ -13,7 +13,7 @@ use crate::types::{Document, document::HeadingLevel::*}; use crate::types::Response; use std::panic::{catch_unwind, AssertUnwindSafe}; use std::task::Poll; -use futures_core::future::Future; +use std::future::Future; use tokio::time; #[cfg(feature="serve_dir")]