title: How can I return early from a futures 0.1 chain of combinator methods?
body: <p>Is there a way to return early from a future combinator chain? For example, I'd like to return success if some condition holds, otherwise keep going down the chain.</p>
  
  <p>I want to do something similar to this:</p>
  
  <pre class="lang-rust prettyprint-override"><code>fn early_exit() -&gt; impl Future&lt;Item = u32, Error = String&gt; {
      ok::&lt;u32, String&gt;(42)
          .and_then(some_function)
          .and_then(another_function)
          .and_then(|x| {
              // return early if condition is satisfied
              if some_condition(x) {
                  return ok::&lt;u32, String&gt;(42);
              }
              // Else pass it down the combinator chain for further transformations
              else {
                  Ok(x)
              }
          })
          .and_then(one_more_function)
          .and_then(last_function)
  }
  </code></pre>
  
  <p>I think this should be doable with <code>async</code>/<code>await</code>, but is there a good way to do this with futures 0.1?</p>