From edb228839e3aa69077049c8133ecb2bb22f2fab0 Mon Sep 17 00:00:00 2001 From: Niklas Adolfsson Date: Mon, 16 Jul 2018 13:43:14 +0200 Subject: [PATCH] Fix `todo` in `ethcore/types::Receipt` constructor (#9086) Remove needless mutable variable and assignment --- ethcore/types/src/receipt.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ethcore/types/src/receipt.rs b/ethcore/types/src/receipt.rs index 81233d212..e9ae1ad8d 100644 --- a/ethcore/types/src/receipt.rs +++ b/ethcore/types/src/receipt.rs @@ -20,7 +20,7 @@ use ethereum_types::{H160, H256, U256, Address, Bloom}; use heapsize::HeapSizeOf; use rlp::{Rlp, RlpStream, Encodable, Decodable, DecoderError}; -use {BlockNumber}; +use BlockNumber; use log_entry::{LogEntry, LocalizedLogEntry}; /// Transaction outcome store in the receipt. @@ -49,12 +49,12 @@ pub struct Receipt { impl Receipt { /// Create a new receipt. - pub fn new(outcome: TransactionOutcome, gas_used: U256, logs: Vec) -> Receipt { - Receipt { - gas_used: gas_used, - log_bloom: logs.iter().fold(Bloom::default(), |mut b, l| { b = &b | &l.bloom(); b }), //TODO: use |= operator - logs: logs, - outcome: outcome, + pub fn new(outcome: TransactionOutcome, gas_used: U256, logs: Vec) -> Self { + Self { + gas_used, + log_bloom: logs.iter().fold(Bloom::default(), |b, l| b | l.bloom()), + logs, + outcome, } } }