@kornel said in the Reserve try
RFC
As I’ve mentioned before, the ? operator shouldn’t be called a “try operator”. It’s more related to throwing/unwrapping. We could have a separate RFC to bikeshed that
I agree, since the word “try” there is inconsistent with the prefix try_
used all over the library. (As ?
is about early-returning while try_
is about producing a success/failure disjunction like Result
.)
It was introduced in RFC 243 as the following
An ? operator for explicitly propagating “exceptions”.
So I guess the official name is the “explicit exception propagation operator”, but that’s a bit of a mouthful and a poor trait name.
But I can’t come up with something that makes me happy. What would you call it?
My mediocre efforts so far:
-
check
: kinda generic, feels boolean -
test
: too overloaded with#[test]
-
propagate
: I always misspell this -
branch
: since it’s sortof “jump-if-error”, but confusing with ASM and things likecontinue
-
separate
/sift
: for taking out the bit you want – the latter is at least short -
ripcord
: a colourful one from someone on IRC
* braces for the flood *