Compiling futuretest v0.1.0 (file:///mnt/c/Users/Mahmoud/git/futuretest) error[E0271]: type mismatch resolving ` as futures::IntoFuture>::Error == &str` --> src/main.rs:12:10 | 12 | .and_then(|_| | ^^^^^^^^ expected struct `std::string::String`, found &str | = note: expected type `std::string::String` found type `&str` error[E0599]: no method named `and_then` found for type `futures::AndThen, [closure@src/main.rs:11:18: 11:42]>, futures::FutureResult<(), std::string::String>, [closure@src/main.rs:12:19: 15:14]>` in the current scope --> src/main.rs:17:10 | 17 | .and_then(|_| future::result::<(), String>(Err("another &'static str error".to_owned()))) | ^^^^^^^^ | = note: the method `and_then` exists but the following trait bounds were not satisfied: `futures::AndThen, [closure@src/main.rs:11:18: 11:42]>, futures::FutureResult<(), std::string::String>, [closure@src/main.rs:12:19: 15:14]> : futures::Future` `&mut futures::AndThen, [closure@src/main.rs:11:18: 11:42]>, futures::FutureResult<(), std::string::String>, [closure@src/main.rs:12:19: 15:14]> : futures::Future` error: aborting due to 2 previous errors error: Could not compile `futuretest`. To learn more, run the command again with --verbose.