On 06/12/2013 20:55, Léo Testard wrote:
Hi,

Just a suggestion, don't know what it's worth...

For the "not helpful error message" thing, couldn't we extend the
option API, to be able to specify at the creation of a None value
the error string that will be displayed if one calls unwrap() on this
value ? This may be useful in several situations.

That would require making the memory representation of every Option bigger. Just for the (hopefully) uncommon case of task failure, it’s not worth the cost in my opinion.

We could instead have .unwrap() that take an error message, but that leaves the responsibility to the user of the API.

--
Simon Sapin
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to