Skip to content

Commit 8e5b45c

Browse files
committed
Make clippy happy
Signed-off-by: hi-rustin <[email protected]>
1 parent ec9d658 commit 8e5b45c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/dist/temp.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ use crate::utils::raw;
1212
use crate::utils::utils;
1313

1414
#[derive(Debug, ThisError)]
15-
pub(crate) enum Error {
15+
pub(crate) enum CreatingError {
1616
#[error("could not create temp root {}" ,.0.display())]
17-
CreatingRoot(PathBuf),
17+
Root(PathBuf),
1818
#[error("could not create temp file {}",.0.display())]
19-
CreatingFile(PathBuf),
19+
File(PathBuf),
2020
#[error("could not create temp directory {}",.0.display())]
21-
CreatingDirectory(PathBuf),
21+
Directory(PathBuf),
2222
}
2323

2424
#[derive(Debug)]
@@ -106,7 +106,7 @@ impl Cfg {
106106
raw::ensure_dir_exists(&self.root_directory, |p| {
107107
(self.notify_handler)(Notification::CreatingRoot(p));
108108
})
109-
.with_context(|| Error::CreatingRoot(PathBuf::from(&self.root_directory)))
109+
.with_context(|| CreatingError::Root(PathBuf::from(&self.root_directory)))
110110
}
111111

112112
pub(crate) fn new_directory(&self) -> Result<Dir<'_>> {
@@ -122,7 +122,7 @@ impl Cfg {
122122
if !raw::path_exists(&temp_dir) {
123123
(self.notify_handler)(Notification::CreatingDirectory(&temp_dir));
124124
fs::create_dir(&temp_dir)
125-
.with_context(|| Error::CreatingDirectory(PathBuf::from(&temp_dir)))?;
125+
.with_context(|| CreatingError::Directory(PathBuf::from(&temp_dir)))?;
126126
return Ok(Dir {
127127
cfg: self,
128128
path: temp_dir,
@@ -148,7 +148,7 @@ impl Cfg {
148148
if !raw::path_exists(&temp_file) {
149149
(self.notify_handler)(Notification::CreatingFile(&temp_file));
150150
fs::File::create(&temp_file)
151-
.with_context(|| Error::CreatingFile(PathBuf::from(&temp_file)))?;
151+
.with_context(|| CreatingError::File(PathBuf::from(&temp_file)))?;
152152
return Ok(File {
153153
cfg: self,
154154
path: temp_file,

0 commit comments

Comments
 (0)