Simplify by removing genericity.

Nothing to be generic over
This commit is contained in:
Magnus Hoff 2017-09-08 14:46:18 +02:00
parent 6f94b2f960
commit db4f18807d
2 changed files with 3 additions and 2 deletions

View file

@ -157,10 +157,11 @@ impl Resource for ArticleResource {
).boxed()
}
fn put<S: 'static + futures::Stream<Item=hyper::Chunk, Error=hyper::Error> + Send + Sync>(self, body: S) -> futures::BoxFuture<Response, Box<::std::error::Error + Send + Sync>> {
fn put(self, body: hyper::Body) -> futures::BoxFuture<Response, Box<::std::error::Error + Send + Sync>> {
// TODO Check incoming Content-Type
use chrono::{TimeZone, Local};
use futures::Stream;
#[derive(Deserialize)]
struct UpdateArticle {

View file

@ -13,7 +13,7 @@ pub trait Resource {
fn allow(&self) -> Vec<hyper::Method>;
fn head(&self) -> futures::BoxFuture<server::Response, Error>;
fn get(self) -> futures::BoxFuture<server::Response, Error>;
fn put<S: 'static + futures::Stream<Item=hyper::Chunk, Error=hyper::Error> + Send + Sync>(self, body: S) -> futures::BoxFuture<server::Response, Error>;
fn put(self, body: hyper::Body) -> futures::BoxFuture<server::Response, Error>;
fn options(&self) -> Response {
Response::new()