From a5e06ec5e98e877497cbe22557083b6c3e755bc6 Mon Sep 17 00:00:00 2001 From: nk_ysg Date: Tue, 15 Oct 2024 01:54:45 +0800 Subject: [PATCH] chore: unify use Option ref (#1477) * chore: unify use Option ref * update geth --- crates/node-bindings/src/nodes/geth.rs | 12 ++++++------ crates/node-bindings/src/nodes/reth.rs | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/crates/node-bindings/src/nodes/geth.rs b/crates/node-bindings/src/nodes/geth.rs index a76e6c274c5..ba205d6077f 100644 --- a/crates/node-bindings/src/nodes/geth.rs +++ b/crates/node-bindings/src/nodes/geth.rs @@ -121,19 +121,19 @@ impl GethInstance { } /// Returns the path to this instances' data directory - pub const fn data_dir(&self) -> &Option { - &self.data_dir + pub const fn data_dir(&self) -> Option<&PathBuf> { + self.data_dir.as_ref() } /// Returns the genesis configuration used to configure this instance - pub const fn genesis(&self) -> &Option { - &self.genesis + pub const fn genesis(&self) -> Option<&Genesis> { + self.genesis.as_ref() } /// Returns the private key used to configure clique on this instance #[deprecated = "clique support was removed in geth >=1.14"] - pub const fn clique_private_key(&self) -> &Option { - &self.clique_private_key + pub const fn clique_private_key(&self) -> Option<&SigningKey> { + self.clique_private_key.as_ref() } /// Takes the stderr contained in the child process. diff --git a/crates/node-bindings/src/nodes/reth.rs b/crates/node-bindings/src/nodes/reth.rs index b61653be5bf..a7a90edc7a4 100644 --- a/crates/node-bindings/src/nodes/reth.rs +++ b/crates/node-bindings/src/nodes/reth.rs @@ -102,13 +102,13 @@ impl RethInstance { } /// Returns the path to this instances' data directory. - pub const fn data_dir(&self) -> &Option { - &self.data_dir + pub const fn data_dir(&self) -> Option<&PathBuf> { + self.data_dir.as_ref() } /// Returns the genesis configuration used to configure this instance - pub const fn genesis(&self) -> &Option { - &self.genesis + pub const fn genesis(&self) -> Option<&Genesis> { + self.genesis.as_ref() } /// Takes the stdout contained in the child process.