handle returns correctly for transactional (#7301)

This commit is contained in:
Xiliang Chen
2020-10-12 23:00:19 +13:00
committed by GitHub
parent 806dc9a659
commit 5172777c7d
2 changed files with 8 additions and 3 deletions
@@ -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 {