While looking at the last example in the documentation for the collect method (at Iterator in std::iter - Rust), I started searching for the implementation of the collect method that makes the collect return the first (and only the first) Err object from a list of Err object (As described at result.rs - source - see definition for FromIterator method).
Could someone point me where in source is such behavior defined ?
Thanks @alice. Seems like process_results has the code that has the logic to select the error if it has an error anywhere in the given iterator (using ResultShunt).
Although I am still learning the language (about half way in the Rust book) I would revisit it once I have covered more ground and this would make much more sense to me. Thanks.