From 8805d04183995a69cf39cc28717c460a8b5a6277 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Sun, 27 Mar 2016 01:41:28 +0100 Subject: [PATCH] Minor refactor. --- parity/main.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/parity/main.rs b/parity/main.rs index 187e855b9..12dd569a3 100644 --- a/parity/main.rs +++ b/parity/main.rs @@ -498,18 +498,15 @@ impl Configuration { } } - fn passwords(&self) -> Vec { - self.args.flag_password.iter().map(|filename| { - let mut buffer = String::new(); - File::open(filename).and_then(|mut f| f.read_to_string(&mut buffer)).unwrap_or_else(|_| die!("{} Unable to read password file. Ensure it exists and permissions are correct.", filename)); - buffer - }).collect() - } - fn account_service(&self) -> AccountService { // Secret Store + let passwords = self.args.flag_password.iter().map(|filename| { + let mut buffer = String::new(); + File::open(filename).and_then(|mut f| f.read_to_string(&mut buffer)).unwrap_or_else(|_| die!("{} Unable to read password file. Ensure it exists and permissions are correct.", filename)); + buffer + }).collect::>(); + let account_service = AccountService::new(); - let passwords = self.passwords(); for d in &self.args.flag_unlock { let a = Address::from_str(clean_0x(&d)).unwrap_or_else(|_| { die!("{}: Invalid address for --unlock. Must be 40 hex characters, without the 0x at the beginning.", d)