mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-16 20:39:10 +00:00
## Issue Addressed Fixes the new clippy lints for rust 1.66 ## Proposed Changes Most of the changes come from: - [unnecessary_cast](https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast) - [iter_kv_map](https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map) - [needless_borrow](https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow) ## Additional Info na
25 lines
612 B
Rust
25 lines
612 B
Rust
use crate::WALLETS_DIR_FLAG;
|
|
use clap::App;
|
|
use eth2_wallet_manager::WalletManager;
|
|
use std::path::PathBuf;
|
|
|
|
pub const CMD: &str = "list";
|
|
|
|
pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
|
|
App::new(CMD).about("Lists the names of all wallets.")
|
|
}
|
|
|
|
pub fn cli_run(wallet_base_dir: PathBuf) -> Result<(), String> {
|
|
let mgr = WalletManager::open(wallet_base_dir)
|
|
.map_err(|e| format!("Unable to open --{}: {:?}", WALLETS_DIR_FLAG, e))?;
|
|
|
|
for (name, _uuid) in mgr
|
|
.wallets()
|
|
.map_err(|e| format!("Unable to list wallets: {:?}", e))?
|
|
{
|
|
println!("{}", name)
|
|
}
|
|
|
|
Ok(())
|
|
}
|