From 2243bc33ed5ca0a551ad8859f007ad23d08a7ed0 Mon Sep 17 00:00:00 2001 From: Za Wilcox Date: Wed, 16 Oct 2019 18:03:33 -0600 Subject: [PATCH 1/3] update clone instruction to use ssh, and current repo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d26ff89..658fd41 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ Zecwallet-CLI does automatic note and utxo management, which means it doesn't al * Run `rustup update` to get the latest version of Rust if you already have it installed ``` -git clone https://github.com/adityapk00/lightwalletclient.git +git clone git@github.com:adityapk00/zecwallet-light-cli.git cargo build --release ./target/release/zecwallet-cli ``` From 28aacf3f50182be0ce73dcd844add724f884c36c Mon Sep 17 00:00:00 2001 From: Za Wilcox Date: Wed, 16 Oct 2019 21:20:03 -0600 Subject: [PATCH 2/3] remove use and make name explicit where used (#5) * remove use and make name explicit where used This commit suggests a readability enhancement. Removing the "use" directive, and making the rustyline::Editor usage explicit at the call site, allows the reader to look in one less place. * make ReadlineError explicit * mv clap::{Arg, App} adjacent to use * remove unused {} * make Duration explicit, remove use --- src/main.rs | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/main.rs b/src/main.rs index 023ff4f..6881f8b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,6 @@ use std::io::{Result, Error, ErrorKind}; -use std::sync::{Arc}; +use std::sync::Arc; use std::sync::mpsc::{channel, Sender, Receiver}; -use std::time::Duration; use zecwalletlitelib::{commands, lightclient::{self, LightClient, LightClientConfig}, @@ -18,10 +17,6 @@ use log4rs::append::rolling_file::policy::compound::{ roll::fixed_window::FixedWindowRoller, }; -use rustyline::error::ReadlineError; -use rustyline::Editor; - -use clap::{Arg, App}; /// Build the Logging config @@ -57,6 +52,7 @@ fn get_log_config(config: &LightClientConfig) -> Result { pub fn main() { // Get command line arguments + use clap::{Arg, App}; let matches = App::new("Zecwallet CLI") .version("1.0.0") .arg(Arg::with_name("seed") @@ -183,7 +179,7 @@ fn startup(server: http::Uri, dangerous: bool, seed: Option, first_sync: fn start_interactive(command_tx: Sender<(String, Vec)>, resp_rx: Receiver) { // `()` can be used when no completer is required - let mut rl = Editor::<()>::new(); + let mut rl = rustyline::Editor::<()>::new(); println!("Ready!"); @@ -235,13 +231,13 @@ fn start_interactive(command_tx: Sender<(String, Vec)>, resp_rx: Receive break; } }, - Err(ReadlineError::Interrupted) => { + Err(rustyline::error::ReadlineError::Interrupted) => { println!("CTRL-C"); info!("CTRL-C"); println!("{}", send_command("save".to_string(), vec![])); break }, - Err(ReadlineError::Eof) => { + Err(rustyline::error::ReadlineError::Eof) => { println!("CTRL-D"); info!("CTRL-D"); println!("{}", send_command("save".to_string(), vec![])); @@ -263,7 +259,7 @@ fn command_loop(lightclient: Arc) -> (Sender<(String, Vec)> let lc = lightclient.clone(); std::thread::spawn(move || { loop { - match command_rx.recv_timeout(Duration::from_secs(5 * 60)) { + match command_rx.recv_timeout(std::time::Duration::from_secs(5 * 60)) { Ok((cmd, args)) => { let args = args.iter().map(|s| s.as_ref()).collect(); @@ -315,4 +311,4 @@ fn attempt_recover_seed() { let phrase = Mnemonic::from_entropy(&seed_bytes, Language::English,).unwrap().phrase().to_string(); println!("Recovered seed phrase:\n{}", phrase); -} \ No newline at end of file +} From 1c1fd0cdf4292b570e15f34a5f5749dd710fc26b Mon Sep 17 00:00:00 2001 From: adityapk00 <31996805+adityapk00@users.noreply.github.com> Date: Thu, 17 Oct 2019 07:12:03 -0700 Subject: [PATCH 3/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 658fd41..7072890 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ Zecwallet-CLI does automatic note and utxo management, which means it doesn't al * Run `rustup update` to get the latest version of Rust if you already have it installed ``` -git clone git@github.com:adityapk00/zecwallet-light-cli.git +git clone https://github.com/adityapk00/zecwallet-light-cli.git cargo build --release ./target/release/zecwallet-cli ```