Skip to content

Instantly share code, notes, and snippets.

@kinggoesgaming
Created July 16, 2017 18:41
Show Gist options
  • Save kinggoesgaming/386c15b04ccd05415610fced26873b91 to your computer and use it in GitHub Desktop.
Save kinggoesgaming/386c15b04ccd05415610fced26873b91 to your computer and use it in GitHub Desktop.
Compiling ore v0.1.0 (file:///home/kgg_dev/src/ore)
error[E0277]: the trait bound `(): futures::Future` is not satisfied
--> src/project/mod.rs:62:38
|
62 | res.body().concat2().and_then(move |body| {
| ^^^^^^^^ the trait `futures::Future` is not implemented for `()`
|
= note: required because of the requirements on the impl of `futures::IntoFuture` for `()`
error[E0277]: the trait bound `(): futures::Future` is not satisfied
--> src/project/mod.rs:61:14
|
61 | .and_then(|res| {
| ^^^^^^^^ the trait `futures::Future` is not implemented for `()`
|
= note: required because of the requirements on the impl of `futures::IntoFuture` for `()`
= note: required because of the requirements on the impl of `futures::Future` for `futures::AndThen<futures::stream::Concat2<hyper::Body>, (), [closure@src/project/mod.rs:62:47: 64:18 data:_]>`
error[E0277]: the trait bound `(): futures::Future` is not satisfied
--> src/project/mod.rs:67:14
|
67 | core.run(get)?;
| ^^^ the trait `futures::Future` is not implemented for `()`
|
= note: required because of the requirements on the impl of `futures::IntoFuture` for `()`
error[E0277]: the trait bound `(): futures::Future` is not satisfied
--> src/project/mod.rs:62:38
|
62 | res.body().concat2().and_then(move |body| {
| ^^^^^^^^ the trait `futures::Future` is not implemented for `()`
|
= note: required because of the requirements on the impl of `futures::IntoFuture` for `()`
error[E0277]: the trait bound `(): futures::Future` is not satisfied
--> src/project/mod.rs:61:14
|
61 | .and_then(|res| {
| ^^^^^^^^ the trait `futures::Future` is not implemented for `()`
|
= note: required because of the requirements on the impl of `futures::IntoFuture` for `()`
= note: required because of the requirements on the impl of `futures::Future` for `futures::AndThen<futures::stream::Concat2<hyper::Body>, (), [closure@src/project/mod.rs:62:47: 64:18 data:_]>`
error[E0277]: the trait bound `(): futures::Future` is not satisfied
--> src/project/mod.rs:67:14
|
67 | core.run(get)?;
| ^^^ the trait `futures::Future` is not implemented for `()`
|
= note: required because of the requirements on the impl of `futures::IntoFuture` for `()`
error: aborting due to 3 previous errors
error: Could not compile `ore`.
error: aborting due to 3 previous errors
error: build failed
fn request(&self, threads: usize, uri: &str) -> request::Result<&[u8]> {
use futures::{Future,Stream};
use hyper;
use hyper::client;
use hyper_tls;
use tokio_core::reactor;
let mut core = reactor::Core::new()?;
let client = hyper::Client::configure()
.connector(hyper_tls::HttpsConnector::new(threads, &core.handle())?)
.build(&core.handle());
let uri = format!("{}/projects/{}", uri, self.plugin_id);
let data: &[u8];
let get = client.get(uri.parse()?)
.and_then(|res| {
res.body().concat2().and_then(move |body| {
data = &body;
})
});
core.run(get)?;
Ok(data)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment