Skip to content

Commit

Permalink
chore: mem take topics when converting logs (#7048)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Mar 8, 2024
1 parent 91c7dd0 commit eb6a959
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions crates/primitives/src/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ pub struct Log {
}

impl From<AlloyLog> for Log {
fn from(log: AlloyLog) -> Self {
Self { address: log.address, topics: log.topics().to_vec(), data: log.data.data }
fn from(mut log: AlloyLog) -> Self {
Self {
address: log.address,
topics: std::mem::take(log.data.topics_mut_unchecked()),
data: log.data.data,
}
}
}

Expand Down

0 comments on commit eb6a959

Please sign in to comment.