0.2.5 - update dependencies and prepare for publishing

This commit is contained in:
Jeremy Soller
2019-11-29 10:06:39 -07:00
parent 3b0f59cbb0
commit 7c5236fe35
3 changed files with 239 additions and 312 deletions
+6 -2
View File
@@ -32,7 +32,7 @@ const REMOTE: &'static str = "https://static.redox-os.org/pkg";
/// by redox_users. If the password is blank, the hash is blank.
fn hash_password(password: &str) -> Result<String> {
if password != "" {
let salt = format!("{:X}", OsRng::new()?.next_u64());
let salt = format!("{:X}", OsRng.next_u64());
let config = argon2::Config::default();
let hash = argon2::hash_encoded(password.as_bytes(), salt.as_bytes(), &config)?;
Ok(hash)
@@ -45,7 +45,11 @@ fn unwrap_or_prompt<T: FromStr>(option: Option<T>, context: &mut liner::Context,
match option {
Some(t) => Ok(t),
None => {
let line = context.read_line(prompt, &mut |_| {})?;
let line = context.read_line(
prompt,
None,
&mut liner::BasicCompleter::new(Vec::<String>::new())
)?;
T::from_str(&line).map_err(|_err| err_msg("failed to parse input"))
}
}