Skip to content

Commit e2832a8

Browse files
committed
clean up wrapping with Secret in commands
1 parent 994ffbc commit e2832a8

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/bin/cargo/commands/login.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use crate::command_prelude::*;
22

33
use cargo::ops;
4-
use cargo::util::auth::Secret;
54

65
pub fn cli() -> Command {
76
subcommand("login")
@@ -37,7 +36,7 @@ pub fn cli() -> Command {
3736
pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {
3837
ops::registry_login(
3938
config,
40-
args.get_one("token").map(String::as_str).map(Secret::from),
39+
args.get_one::<String>("token").map(|s| s.as_str().into()),
4140
args.get_one("registry").map(String::as_str),
4241
args.flag("generate-keypair"),
4342
args.flag("secret-key"),

src/bin/cargo/commands/publish.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use crate::command_prelude::*;
22

33
use cargo::ops::{self, PublishOpts};
4-
use cargo::util::auth::Secret;
54

65
pub fn cli() -> Command {
76
subcommand("publish")
@@ -39,7 +38,7 @@ pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {
3938
config,
4039
token: args
4140
.get_one::<String>("token")
42-
.map(|s| Secret::from(s.to_string())),
41+
.map(|s| s.to_string().into()),
4342
index,
4443
verify: !args.flag("no-verify"),
4544
allow_dirty: args.flag("allow-dirty"),

0 commit comments

Comments
 (0)