Skip to content

Commit 4d35e3c

Browse files
authored
minor refactor to use implemented deref trait (#69)
Minor refactoring to use already implemented`Deref` trait, for cleaner syntax. https://github.com/circlefin/arc-node/blob/cf51a199710aaf2e2ae0afa31512c56241d9e29a/crates/eth-engine/src/engine.rs#L269-L275 We introduce a few one line changes shown here to access fields of `Engine` ```diff - match &self.0.disconnect_rx { + match &self.disconnect_rx { ```
2 parents c639319 + 1fab016 commit 4d35e3c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

crates/eth-engine/src/engine.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ impl Engine {
173173
/// Stays pending forever for non-IPC engines (RPC, mock), so calling code can
174174
/// unconditionally `select!` on this without special-casing the transport.
175175
pub async fn wait_for_disconnect(&self) {
176-
match &self.0.disconnect_rx {
176+
match &self.disconnect_rx {
177177
// wait_for checks the current value first, so late subscribers see a prior disconnect.
178178
Some(rx) => {
179179
rx.clone().wait_for(|&v| v).await.ok();
@@ -188,7 +188,7 @@ impl Engine {
188188
/// The provided function should use the same chainspec as the EL so that
189189
/// the V4/V5 decision always aligns.
190190
pub fn set_is_osaka_active(&self, f: IsOsakaActiveFn) {
191-
if self.0.is_osaka_active.set(f).is_err() {
191+
if self.is_osaka_active.set(f).is_err() {
192192
tracing::warn!("Osaka activation function already set; ignoring duplicate call");
193193
}
194194
}
@@ -262,7 +262,7 @@ impl Engine {
262262
/// if one was configured. `None` for test/mock engines or RPC without
263263
/// `--execution-ws-endpoint`.
264264
pub fn subscription_endpoint(&self) -> Option<&SubscriptionEndpoint> {
265-
self.0.subscription_endpoint.as_ref()
265+
self.subscription_endpoint.as_ref()
266266
}
267267
}
268268

0 commit comments

Comments
 (0)