Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duck sync 66f250565403f8d21d43f266ba666c4c0bf9b3b8 #71

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@ readme = "README.md"
keywords = ["read", "password", "security", "pass", "getpass"]
edition = "2018"

[features]
serde = ["dep:serde", "dep:serde_json"]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, this new dep: syntax prevents rpassword 7.0.0 from being using with rust 1.59 and older. See rust-lang/cargo#10623

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right, good spot! I've added a note about this in the release on Github.


[target.'cfg(unix)'.dependencies]
libc = "0.2"

[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features = ["std", "winnt", "fileapi", "processenv", "winbase", "handleapi", "consoleapi", "minwindef", "wincon"] }

[dependencies]
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"], optional = true }
serde_json = { version = "1.0", optional = true }
6 changes: 5 additions & 1 deletion src/rpassword/all.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,15 @@ mod windows {

let hidden_input = HiddenInput::new(handle)?;

reader.read_line(&mut password)?;
let reader_return = reader.read_line(&mut password);

// Newline for windows which otherwise prints on the same line.
println!();

if reader_return.is_err() {
return Err(reader_return.unwrap_err());
}

std::mem::drop(hidden_input);

super::fix_new_line(password.into_inner())
Expand Down
1 change: 1 addition & 0 deletions src/rutil.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ pub mod atty;
pub mod fix_new_line;
pub mod print_tty;
pub mod safe_string;
#[cfg(feature = "serde")]
pub mod safe_string_serde;
pub mod safe_vec;