@@ -96,7 +96,7 @@ impl RegistryCredentialConfig {
9696
9797pub struct PublishOpts < ' cfg > {
9898 pub config : & ' cfg Config ,
99- pub token : Option < String > ,
99+ pub token : Option < Secret < String > > ,
100100 pub index : Option < String > ,
101101 pub verify : bool ,
102102 pub allow_dirty : bool ,
@@ -174,7 +174,7 @@ pub fn publish(ws: &Workspace<'_>, opts: &PublishOpts<'_>) -> CargoResult<()> {
174174
175175 let ( mut registry, reg_ids) = registry (
176176 opts. config ,
177- opts. token . as_deref ( ) . map ( Secret :: from ) ,
177+ opts. token . as_ref ( ) . map ( Secret :: as_deref ) ,
178178 opts. index . as_deref ( ) ,
179179 publish_registry. as_deref ( ) ,
180180 true ,
@@ -786,7 +786,7 @@ fn http_proxy_exists(config: &Config) -> CargoResult<bool> {
786786
787787pub fn registry_login (
788788 config : & Config ,
789- token : Option < & str > ,
789+ token : Option < Secret < & str > > ,
790790 reg : Option < & str > ,
791791 generate_keypair : bool ,
792792 secret_key_required : bool ,
@@ -939,7 +939,7 @@ pub fn registry_logout(config: &Config, reg: Option<&str>) -> CargoResult<()> {
939939
940940pub struct OwnersOptions {
941941 pub krate : Option < String > ,
942- pub token : Option < String > ,
942+ pub token : Option < Secret < String > > ,
943943 pub index : Option < String > ,
944944 pub to_add : Option < Vec < String > > ,
945945 pub to_remove : Option < Vec < String > > ,
@@ -961,7 +961,7 @@ pub fn modify_owners(config: &Config, opts: &OwnersOptions) -> CargoResult<()> {
961961
962962 let ( mut registry, _) = registry (
963963 config,
964- opts. token . as_deref ( ) . map ( Secret :: from ) ,
964+ opts. token . as_ref ( ) . map ( Secret :: as_deref ) ,
965965 opts. index . as_deref ( ) ,
966966 opts. registry . as_deref ( ) ,
967967 true ,
@@ -1020,7 +1020,7 @@ pub fn yank(
10201020 config : & Config ,
10211021 krate : Option < String > ,
10221022 version : Option < String > ,
1023- token : Option < String > ,
1023+ token : Option < Secret < String > > ,
10241024 index : Option < String > ,
10251025 undo : bool ,
10261026 reg : Option < String > ,
@@ -1052,7 +1052,7 @@ pub fn yank(
10521052
10531053 let ( mut registry, _) = registry (
10541054 config,
1055- token. as_deref ( ) . map ( Secret :: from ) ,
1055+ token. as_ref ( ) . map ( Secret :: as_deref ) ,
10561056 index. as_deref ( ) ,
10571057 reg. as_deref ( ) ,
10581058 true ,
0 commit comments