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 }
30
30
zeroize = { version = " 1.1.1" , optional = true }
31
31
fuzzy-matcher = { version = " 0.3.7" , optional = true }
32
32
shell-words = " 1.1.0"
33
- thiserror = " 1.0.40"
34
33
35
34
[[example ]]
36
35
name = " 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 } ;
4
2
5
3
/// Possible errors returned by prompts.
6
- #[ derive( Error , Debug ) ]
4
+ #[ derive( Debug ) ]
7
5
pub enum Error {
8
6
/// 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
+ }
11
24
}
12
25
13
26
/// Result type where errors are of type [Error](enum@Error).
You can’t perform that action at this time.
0 commit comments