mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-07 00:42:42 +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:
@@ -21,7 +21,7 @@ use scrypt::{
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sha2::{Digest, Sha256};
|
||||
use std::fs::OpenOptions;
|
||||
use std::fs::File;
|
||||
use std::io::{Read, Write};
|
||||
use std::iter::FromIterator;
|
||||
use std::path::Path;
|
||||
@@ -329,7 +329,7 @@ impl Keystore {
|
||||
|
||||
/// Instantiates `self` by reading a JSON file at `path`.
|
||||
pub fn from_json_file<P: AsRef<Path>>(path: P) -> Result<Self, Error> {
|
||||
OpenOptions::new()
|
||||
File::options()
|
||||
.read(true)
|
||||
.write(false)
|
||||
.create(false)
|
||||
|
||||
@@ -7,7 +7,7 @@ use eth2_keystore::{
|
||||
json_keystore::{Kdf, Pbkdf2, Prf, Scrypt},
|
||||
Error, Keystore, KeystoreBuilder, DKLEN,
|
||||
};
|
||||
use std::fs::OpenOptions;
|
||||
use std::fs::File;
|
||||
use tempfile::tempdir;
|
||||
|
||||
const GOOD_PASSWORD: &[u8] = &[42, 42, 42];
|
||||
@@ -55,7 +55,7 @@ fn file() {
|
||||
let path = dir.path().join("keystore.json");
|
||||
|
||||
let get_file = || {
|
||||
OpenOptions::new()
|
||||
File::options()
|
||||
.write(true)
|
||||
.read(true)
|
||||
.create(true)
|
||||
|
||||
Reference in New Issue
Block a user