@@ -12,13 +12,13 @@ use crate::utils::raw;
12
12
use crate :: utils:: utils;
13
13
14
14
#[ derive( Debug , ThisError ) ]
15
- pub ( crate ) enum Error {
15
+ pub ( crate ) enum CreatingError {
16
16
#[ error( "could not create temp root {}" , . 0 . display( ) ) ]
17
- CreatingRoot ( PathBuf ) ,
17
+ Root ( PathBuf ) ,
18
18
#[ error( "could not create temp file {}" , . 0 . display( ) ) ]
19
- CreatingFile ( PathBuf ) ,
19
+ File ( PathBuf ) ,
20
20
#[ error( "could not create temp directory {}" , . 0 . display( ) ) ]
21
- CreatingDirectory ( PathBuf ) ,
21
+ Directory ( PathBuf ) ,
22
22
}
23
23
24
24
#[ derive( Debug ) ]
@@ -106,7 +106,7 @@ impl Cfg {
106
106
raw:: ensure_dir_exists ( & self . root_directory , |p| {
107
107
( self . notify_handler ) ( Notification :: CreatingRoot ( p) ) ;
108
108
} )
109
- . with_context ( || Error :: CreatingRoot ( PathBuf :: from ( & self . root_directory ) ) )
109
+ . with_context ( || CreatingError :: Root ( PathBuf :: from ( & self . root_directory ) ) )
110
110
}
111
111
112
112
pub ( crate ) fn new_directory ( & self ) -> Result < Dir < ' _ > > {
@@ -122,7 +122,7 @@ impl Cfg {
122
122
if !raw:: path_exists ( & temp_dir) {
123
123
( self . notify_handler ) ( Notification :: CreatingDirectory ( & temp_dir) ) ;
124
124
fs:: create_dir ( & temp_dir)
125
- . with_context ( || Error :: CreatingDirectory ( PathBuf :: from ( & temp_dir) ) ) ?;
125
+ . with_context ( || CreatingError :: Directory ( PathBuf :: from ( & temp_dir) ) ) ?;
126
126
return Ok ( Dir {
127
127
cfg : self ,
128
128
path : temp_dir,
@@ -148,7 +148,7 @@ impl Cfg {
148
148
if !raw:: path_exists ( & temp_file) {
149
149
( self . notify_handler ) ( Notification :: CreatingFile ( & temp_file) ) ;
150
150
fs:: File :: create ( & temp_file)
151
- . with_context ( || Error :: CreatingFile ( PathBuf :: from ( & temp_file) ) ) ?;
151
+ . with_context ( || CreatingError :: File ( PathBuf :: from ( & temp_file) ) ) ?;
152
152
return Ok ( File {
153
153
cfg : self ,
154
154
path : temp_file,
0 commit comments