chore: mem take topics when converting logs (#7048)

This commit is contained in:
Matthias Seitz
2024-03-08 13:58:13 +01:00
committed by GitHub
parent 91c7dd04b7
commit eb6a95949b

View File

@@ -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,
}
}
}