Skip to content

Commit

Permalink
chore: unify use Option ref (#1477)
Browse files Browse the repository at this point in the history
* chore: unify use Option ref

* update geth
  • Loading branch information
nkysg authored Oct 14, 2024
1 parent 04d9368 commit a5e06ec
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions crates/node-bindings/src/nodes/geth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,19 +121,19 @@ impl GethInstance {
}

/// Returns the path to this instances' data directory
pub const fn data_dir(&self) -> &Option<PathBuf> {
&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<Genesis> {
&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<SigningKey> {
&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.
Expand Down
8 changes: 4 additions & 4 deletions crates/node-bindings/src/nodes/reth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ impl RethInstance {
}

/// Returns the path to this instances' data directory.
pub const fn data_dir(&self) -> &Option<PathBuf> {
&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<Genesis> {
&self.genesis
pub const fn genesis(&self) -> Option<&Genesis> {
self.genesis.as_ref()
}

/// Takes the stdout contained in the child process.
Expand Down

0 comments on commit a5e06ec

Please sign in to comment.