Summary:
[Folly] Pass `Try` by rvalue ref in `onError` implementation.
As is done in other overloads and in `thenImplementation`. For consistency.
Reviewed By: spacedentist
Differential Revision:
D5199302
fbshipit-source-id:
c78db0c36fc7a0b846ca5e44fc237422c9203a24
if (tf2.hasException()) {
state.setException(std::move(tf2.exception()));
} else {
- tf2->setCallback_([p = state.stealPromise()](Try<T> t3) mutable {
+ tf2->setCallback_([p = state.stealPromise()](Try<T> && t3) mutable {
p.setTry(std::move(t3));
});
}
auto f = p.getFuture();
setCallback_(
[state = detail::makeCoreCallbackState(
- std::move(p), std::forward<F>(func))](Try<T> t) mutable {
+ std::move(p), std::forward<F>(func))](Try<T> && t) mutable {
if (t.hasException()) {
state.setTry(makeTryWith(
[&] { return state.invoke(std::move(t.exception())); }));