Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: asRef for Log #820

Merged
merged 1 commit into from
Dec 5, 2024
Merged

chore: asRef for Log #820

merged 1 commit into from
Dec 5, 2024

Conversation

mattsse
Copy link
Member

@mattsse mattsse commented Dec 5, 2024

adds AsRef<Self> for Log

this is useful for because we have layered logs types (rpc::Log) and we'd like to have impl TxReveipt where T: AsRef<Log>

currently we use Borrow but this is semantically incorrect:

Borrow also requires that Hash, Eq and Ord for a borrowed value are equivalent to those of the owned value. For this reason, if you want to borrow only a single field of a struct you can implement AsRef, but not Borrow.
https://doc.rust-lang.org/std/convert/trait.AsRef.html

@klkvr klkvr enabled auto-merge (squash) December 5, 2024 11:41
@klkvr klkvr merged commit c4f94bd into main Dec 5, 2024
30 checks passed
@klkvr klkvr deleted the matt/add-as-ref-for-log branch December 5, 2024 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants