-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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: remove some clones #12008
chore: remove some clones #12008
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm,
one pedantic nit
@@ -156,7 +150,7 @@ where | |||
/// a result indicating success with the payload or an error in case of failure. | |||
#[inline] | |||
pub(crate) fn optimism_payload<EvmConfig, Pool, Client>( | |||
evm_config: EvmConfig, | |||
evm_config: &EvmConfig, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not strictly required
evm_config: &EvmConfig, | |
evm_config: EvmConfig, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, we need this to pass &self.evm_config
in from try_build
and build_empty_payload
instead of cloning anew?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EvmConfig is auto_impl for & so this shouldn't be required by we can also do &
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't work 😅.
error[E0521]: borrowed data escapes outside of method
--> crates/optimism/payload/src/builder.rs:108:9
|
104 | &self,
| -----
| |
| `self` is a reference that is only valid in the method body
| let's call the lifetime of this reference `'1`
...
108 | optimism_payload(&self.evm_config, args, cfg_env, block_env, self.compute_pending_block)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| `self` escapes the method body here
| argument requires that `'1` must outlive `'static`
No description provided.