Skip to content

Commit

Permalink
Update dependencies and 0.5.6 (#53)
Browse files Browse the repository at this point in the history
* Update to rpassword 7.0.0

* Update serde_yaml

* Bump to 0.5.6
  • Loading branch information
brycx authored Sep 23, 2022
1 parent 4e7d874 commit 45c9689
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "checkpwn"
version = "0.5.4"
version = "0.5.6"
authors = ["brycx <brycx@protonmail.com>"]
description = "Check Have I Been Pwned and see if it's time for you to change passwords."
keywords = [ "cli", "password", "security", "HIBP" ]
Expand All @@ -12,11 +12,11 @@ license = "MIT"

[dependencies]
colored = "2.0"
rpassword = "5.0.0"
rpassword = "7.0.0"
zeroize = "1.3.0"
dirs-next = "2.0.0"
serde = { version = "1.0.106", features = ["derive"] }
serde_yaml = "0.8.11"
serde_yaml = "0.9.13"
checkpwn_lib = "0.2.0"
anyhow = "1.0.33"

Expand Down
4 changes: 2 additions & 2 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ impl Config {
api_key: api_key.to_string(),
};

let config_to_write = serde_yaml::to_vec(&new_config)?;
let config_to_write = serde_yaml::to_string(&new_config)?;
let mut config_file = fs::File::create(&path.config_file_path)?;
config_file.write_all(&config_to_write)?;
config_file.write_all(config_to_write.as_bytes())?;

Ok(())
}
Expand Down
10 changes: 5 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fn main() -> Result<()> {
}
"pass" => {
assert_eq!(argvs.len(), 2);
let hashed_password = Password::new(&rpassword::prompt_password_stdout("Password: ")?)?;
let hashed_password = Password::new(&rpassword::prompt_password("Password: ")?)?;
let is_breached = checkpwn_lib::check_password(&hashed_password)?;
breach_report(is_breached, "", true);
}
Expand Down Expand Up @@ -138,10 +138,10 @@ fn read_file(path: &str) -> Result<BufReader<File>, Error> {
/// Strip all whitespace and all newlines from a given string.
fn strip(string: &str) -> String {
string
.replace("\n", "")
.replace(" ", "")
.replace("\'", "'")
.replace("\t", "")
.replace('\n', "")
.replace(' ', "")
.replace('\'', "")
.replace('\t', "")
}

/// HIBP breach request used for `acc` arguments.
Expand Down

0 comments on commit 45c9689

Please sign in to comment.