@@ -59,14 +59,10 @@ pub struct Context {
59
59
/// Convert the outcome of a helper invocation to a helper result, assuring that the identity is complete in the process.
60
60
#[ allow( clippy:: result_large_err) ]
61
61
pub 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
- }
68
62
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
+ } ) ,
70
66
( helper:: Action :: Get ( ctx) , Some ( mut outcome) ) => match outcome. consume_identity ( ) {
71
67
Some ( identity) => Ok ( Some ( Outcome {
72
68
identity,
@@ -75,7 +71,9 @@ pub fn helper_outcome_to_result(outcome: Option<helper::Outcome>, action: helper
75
71
None => Err ( if outcome. quit {
76
72
Error :: Quit
77
73
} else {
78
- Error :: IdentityMissing { context : redact ( ctx) }
74
+ Error :: IdentityMissing {
75
+ context : ctx. redacted ( ) ,
76
+ }
79
77
} ) ,
80
78
} ,
81
79
( helper:: Action :: Store ( _) | helper:: Action :: Erase ( _) , _ignore) => Ok ( None ) ,
0 commit comments