@@ -59,14 +59,10 @@ pub struct Context {
5959/// Convert the outcome of a helper invocation to a helper result, assuring that the identity is complete in the process.
6060#[ allow( clippy:: result_large_err) ]
6161pub fn helper_outcome_to_result ( outcome : Option < helper:: Outcome > , action : helper:: Action ) -> Result {
62- fn redact ( mut ctx : Context ) -> Context {
63- if let Some ( pw) = ctx. password . as_mut ( ) {
64- * pw = "<redacted>" . into ( ) ;
65- }
66- ctx
67- }
6862 match ( action, outcome) {
69- ( helper:: Action :: Get ( ctx) , None ) => Err ( Error :: IdentityMissing { context : redact ( ctx) } ) ,
63+ ( helper:: Action :: Get ( ctx) , None ) => Err ( Error :: IdentityMissing {
64+ context : ctx. redacted ( ) ,
65+ } ) ,
7066 ( helper:: Action :: Get ( ctx) , Some ( mut outcome) ) => match outcome. consume_identity ( ) {
7167 Some ( identity) => Ok ( Some ( Outcome {
7268 identity,
@@ -75,7 +71,9 @@ pub fn helper_outcome_to_result(outcome: Option<helper::Outcome>, action: helper
7571 None => Err ( if outcome. quit {
7672 Error :: Quit
7773 } else {
78- Error :: IdentityMissing { context : redact ( ctx) }
74+ Error :: IdentityMissing {
75+ context : ctx. redacted ( ) ,
76+ }
7977 } ) ,
8078 } ,
8179 ( helper:: Action :: Store ( _) | helper:: Action :: Erase ( _) , _ignore) => Ok ( None ) ,
0 commit comments