handle returns correctly for transactional (#7301)

This commit is contained in:
Xiliang Chen authored and GitHub committed 2020-10-12 12:00:19 +02:00
1 parent 806dc9a659
commit 5172777c7d
2 files changed
+8 -3

No files matched your search

@@ -29,7 +29,7 @@ pub fn transactional(_attr: TokenStream, input: TokenStream) -> Result<TokenStre
#vis #sig {
use #crate_::storage::{with_transaction, TransactionOutcome};
with_transaction(|| {
let r = #block;
let r = (|| { #block })();
if r.is_ok() {
TransactionOutcome::Commit(r)
} else {