mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-11 18:04:18 +00:00
Replace OpenOptions::new with File::options to be readable (#3059)
## Issue Addressed Closes #3049 This PR updates widely but this replace is safe as `File::options()` is equivelent to `OpenOptions::new()`. ref: https://doc.rust-lang.org/stable/src/std/fs.rs.html#378-380
This commit is contained in:
@@ -6,7 +6,7 @@ use deposit_contract::decode_eth1_tx_data;
|
||||
use derivative::Derivative;
|
||||
use eth2_keystore::{Error as KeystoreError, Keystore, PlainText};
|
||||
use lockfile::{Lockfile, LockfileError};
|
||||
use std::fs::{read, write, OpenOptions};
|
||||
use std::fs::{read, write, File};
|
||||
use std::io;
|
||||
use std::path::{Path, PathBuf};
|
||||
use tree_hash::TreeHash;
|
||||
@@ -211,7 +211,7 @@ pub fn unlock_keypair<P: AsRef<Path>>(
|
||||
password_dir: P,
|
||||
) -> Result<Keypair, Error> {
|
||||
let keystore = Keystore::from_json_reader(
|
||||
&mut OpenOptions::new()
|
||||
&mut File::options()
|
||||
.read(true)
|
||||
.create(false)
|
||||
.open(keystore_path)
|
||||
@@ -236,7 +236,7 @@ pub fn unlock_keypair_from_password_path(
|
||||
password_path: &Path,
|
||||
) -> Result<Keypair, Error> {
|
||||
let keystore = Keystore::from_json_reader(
|
||||
&mut OpenOptions::new()
|
||||
&mut File::options()
|
||||
.read(true)
|
||||
.create(false)
|
||||
.open(keystore_path)
|
||||
|
||||
Reference in New Issue
Block a user