File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
credential/cargo-credential/src Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,12 @@ pub enum Error {
38
38
Unknown ,
39
39
}
40
40
41
+ impl Error {
42
+ pub ( crate ) fn other ( inner : BoxError ) -> Self {
43
+ Self :: Other ( inner)
44
+ }
45
+ }
46
+
41
47
impl StdError for Error {
42
48
fn source ( & self ) -> Option < & ( dyn std:: error:: Error + ' static ) > {
43
49
match self {
@@ -86,7 +92,7 @@ impl From<anyhow::Error> for Error {
86
92
87
93
impl < T : StdError + Send + Sync + ' static > From < Box < T > > for Error {
88
94
fn from ( value : Box < T > ) -> Self {
89
- Error :: Other ( value)
95
+ Error :: other ( value)
90
96
}
91
97
}
92
98
Original file line number Diff line number Diff line change @@ -226,7 +226,7 @@ pub trait Credential {
226
226
227
227
/// Runs the credential interaction
228
228
pub fn main ( credential : impl Credential ) {
229
- let result = doit ( credential) . map_err ( |e| Error :: Other ( e) ) ;
229
+ let result = doit ( credential) . map_err ( |e| Error :: other ( e) ) ;
230
230
if result. is_err ( ) {
231
231
serde_json:: to_writer ( std:: io:: stdout ( ) , & result)
232
232
. expect ( "failed to serialize credential provider error" ) ;
You can’t perform that action at this time.
0 commit comments