File tree Expand file tree Collapse file tree 2 files changed +19
-7
lines changed
Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,6 @@ tempfile = { version = "3", optional = true }
3030zeroize = { version = " 1.1.1" , optional = true }
3131fuzzy-matcher = { version = " 0.3.7" , optional = true }
3232shell-words = " 1.1.0"
33- thiserror = " 1.0.40"
3433
3534[[example ]]
3635name = " password"
Original file line number Diff line number Diff line change 1- use std:: { io:: Error as IoError , result:: Result as StdResult } ;
2-
3- use thiserror:: Error ;
1+ use std:: { fmt, io:: Error as IoError , result:: Result as StdResult } ;
42
53/// Possible errors returned by prompts.
6- #[ derive( Error , Debug ) ]
4+ #[ derive( Debug ) ]
75pub enum Error {
86 /// Error while executing IO operations.
9- #[ error( "IO error: {0}" ) ]
10- IO ( #[ from] IoError ) ,
7+ IO ( IoError ) ,
8+ }
9+
10+ impl fmt:: Display for Error {
11+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
12+ match self {
13+ Self :: IO ( io) => write ! ( f, "IO error: {}" , io) ,
14+ }
15+ }
16+ }
17+
18+ impl std:: error:: Error for Error { }
19+
20+ impl From < IoError > for Error {
21+ fn from ( err : IoError ) -> Self {
22+ Self :: IO ( err)
23+ }
1124}
1225
1326/// Result type where errors are of type [Error](enum@Error).
You can’t perform that action at this time.
0 commit comments