Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd `maybe!` macro equivalent to `try!` #1394
Conversation
hauleth
added some commits
Dec 5, 2015
alexcrichton
added
the
T-libs
label
Dec 5, 2015
This comment has been minimized.
This comment has been minimized.
cassiersg
commented
Dec 7, 2015
|
For reference, there also exists a try_opt crate that does the same thing as soma. |
This comment has been minimized.
This comment has been minimized.
|
@cassiersg I wasn't aware that this already exist. |
This comment has been minimized.
This comment has been minimized.
|
See also #243 |
hauleth
referenced this pull request
Dec 8, 2015
Closed
Expand `try!` macro with additional case #1393
This comment has been minimized.
This comment has been minimized.
4xrsJCr9
commented
Dec 9, 2015
|
Please consider renaming this macro to 'maybe'. |
hauleth
changed the title
Add `try_some` macro equivalent to `try!`
Add `maybe!` macro equivalent to `try!`
Jan 8, 2016
main--
referenced this pull request
Jan 16, 2016
Closed
add some! macro for unwrapping Option more safely #1465
alexcrichton
assigned
aturon
Jan 21, 2016
This comment has been minimized.
This comment has been minimized.
reem
commented
Jan 22, 2016
|
Some alternatives: |
aturon
added
the
I-nominated
label
Feb 2, 2016
This comment has been minimized.
This comment has been minimized.
|
The libs team feels that we are likely to not merge this for now in light of trait-based exception handling having recently landed. We're likely to change |
alexcrichton
added
final-comment-period
and removed
I-nominated
labels
Feb 11, 2016
This comment has been minimized.
This comment has been minimized.
daboross
commented
Feb 16, 2016
|
I feel like this doesn't really need to be a part of the standard library, as it has a lot smaller use case than try! does. I mean it wouldn't be too bad to add it, but it might just be extra bloat. |
This comment has been minimized.
This comment has been minimized.
|
I would strongly avoid naming the macro |
This comment has been minimized.
This comment has been minimized.
k3d3
commented
Feb 16, 2016
|
Having something that deals with Options being called |
This comment has been minimized.
This comment has been minimized.
|
I strongly want a facility for doing this and in the past I've argued for a macro (so many projects have their own for doing this!), however, it seems the best way forward now is to make |
This comment has been minimized.
This comment has been minimized.
|
The libs team discussed this RFC during triage yesterday and the conclusion was to close (in the face of trait-based exception handling). Thanks again though for the RFC @hauleth! |
hauleth commentedDec 5, 2015
Rendered