Skip to content

Commit

Permalink
replace into_receipt by into (#735)
Browse files Browse the repository at this point in the history
  • Loading branch information
tcoratger authored May 13, 2024
1 parent be4ae45 commit 2e15e2f
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions crates/consensus/src/receipt/receipts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ where
}
}

impl<T> From<ReceiptWithBloom<T>> for Receipt<T> {
/// Consume the structure, returning only the receipt
fn from(receipt_with_bloom: ReceiptWithBloom<T>) -> Self {
receipt_with_bloom.receipt
}
}

/// [`Receipt`] with calculated bloom filter.
///
/// This convenience type allows us to lazily calculate the bloom filter for a
Expand Down Expand Up @@ -137,14 +144,8 @@ impl<T: Encodable> ReceiptWithBloom<T> {

impl<T> ReceiptWithBloom<T> {
/// Create new [ReceiptWithBloom]
pub const fn new(receipt: Receipt<T>, bloom: Bloom) -> Self {
Self { receipt, logs_bloom: bloom }
}

/// Consume the structure, returning only the receipt
#[allow(clippy::missing_const_for_fn)] // false positive
pub fn into_receipt(self) -> Receipt<T> {
self.receipt
pub const fn new(receipt: Receipt<T>, logs_bloom: Bloom) -> Self {
Self { receipt, logs_bloom }
}

/// Consume the structure, returning the receipt and the bloom filter
Expand Down

0 comments on commit 2e15e2f

Please sign in to comment.