What's the most idiomatic way of working with an Iterator of Results?
<p>I have code like this:</p>

<pre><code>let things = vec![/* ...*/]; // e.g. Vec&lt;String&gt;
things
    .map(|thing| {
        let a = try!(do_stuff(thing));
        Ok(other_stuff(a))
    })
    .filter(|thing_result| match *thing_result {
        Err(e) =&gt; true,
        Ok(a) =&gt; check(a),
    })
    .map(|thing_result| {
        let a = try!(thing_result);
        // do stuff
        b
    })
    .collect::&lt;Result&lt;Vec&lt;_&gt;, _&gt;&gt;()
</code></pre>

<p>In terms of semantics, I want to stop processing after the first error.</p>

<p>The above code works, but it feels quite cumbersome. Is there a better way? I've looked through the docs for something like <code>filter_if_ok</code>, but I haven't found anything.</p>

<p>I am aware of <code>collect::&lt;Result&lt;Vec&lt;_&gt;, _&gt;&gt;</code>, and it works great. I'm specifically trying to eliminate the following boilerplate:</p>

<ul>
<li>In the filter's closure, I have to use <code>match</code> on <code>thing_result</code>. I feel like this should just be a one-liner, e.g. <code>.filter_if_ok(|thing| check(a))</code>.</li>
<li>Every time I use <code>map</code>, I have to include an extra statement <code>let a = try!(thing_result);</code> in order to deal with the possibility of an <code>Err</code>. Again, I feel like this could be abstracted away into <code>.map_if_ok(|thing| ...)</code>.</li>
</ul>

<p>Is there another approach I can use to get this level of conciseness, or do I just need to tough it out?</p>