egg-mode-rs / egg-mode

a twitter api crate for rust
https://crates.io/crates/egg-mode
Mozilla Public License 2.0
371 stars 65 forks source link

Compilation error message "egg_mode::common::response::TwitterFuture<egg_mode::auth::KeyPair>: core::future::future::Future` is not satisfied" #76

Closed dyoshikawa closed 4 years ago

dyoshikawa commented 4 years ago

I'm a Rust newbie.

I want to try to use the egg-mode.
I made the example repository.

But my code caused a compilation error.

rustc -V

rustc 1.41.0

Dependencies

[dependencies]
egg-mode = { version = "0.13", features = ["hyper-rustls"], default-features = false }
futures = "0.3"

Code

fn main() {
    let con_token = egg_mode::KeyPair::new("consumer key", "consumer secret");
    let request_token = futures::executor::block_on(egg_mode::request_token(&con_token, "oob"));
    //    let auth_url = egg_mode::authorize_url(&request_token);
    //
    //    let verifier = "123456";
    //    let (token, user_id, screen_name) =
    //        egg_mode::access_token(con_token, &request_token, verifier).await.unwrap();
}

Build and Error

$ cargo build
   Compiling twitter-rs-playground v0.1.0 (/Users/dyoshikawa/src/github.com/dyoshikawa/twitter-rs-playground)
error[E0277]: the trait bound `egg_mode::common::response::TwitterFuture<egg_mode::auth::KeyPair>: core::future::future::Future` is not satisfied

Do you have any ideas?
Thank you for reading.

adwhit commented 4 years ago

Hi, this is due to the crate not yet being compatible with futures 0.3. Coming very soon! Until then, use futures 0.1.

dyoshikawa commented 4 years ago

@adwhit Thank you. I knew things around async that change rapidly recently.