We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 020651c commit 8f07d84Copy full SHA for 8f07d84
src/cargo/ops/registry/login.rs
@@ -35,13 +35,15 @@ pub fn registry_login(
35
};
36
37
let mut token_from_stdin = None;
38
- if !std::io::stdin().is_terminal() {
39
- let token = std::io::read_to_string(std::io::stdin()).unwrap_or_default();
40
- if !token.is_empty() {
41
- token_from_stdin = Some(token);
+ let token = token_from_cmdline.or_else(|| {
+ if !std::io::stdin().is_terminal() {
+ let token = std::io::read_to_string(std::io::stdin()).unwrap_or_default();
+ if !token.is_empty() {
42
+ token_from_stdin = Some(token);
43
+ }
44
}
- }
- let token = token_from_cmdline.or_else(|| token_from_stdin.as_deref().map(Secret::from));
45
+ token_from_stdin.as_deref().map(Secret::from)
46
+ });
47
48
let options = LoginOptions {
49
token,
0 commit comments