Skip to content

Commit

Permalink
Change fields order
Browse files Browse the repository at this point in the history
  • Loading branch information
kkocdko committed Apr 4, 2022
1 parent 0c4ee0d commit 1cb8893
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ impl Action {
let recursive = cfg.input_recursive.unwrap();
let ret = visit_dir(dir, recursive).map_err(|e| Error {
kind: ErrorKind::Config,
inner: Box::new(e),
message: "read input dir failed".to_string(),
inner: Box::new(e),
})?;
Ok(ret)
};
Expand Down Expand Up @@ -227,8 +227,8 @@ impl Action {
if e.kind() != io::ErrorKind::NotFound {
return Err(Error {
kind: ErrorKind::Config,
inner: Box::new(e),
message: "remove file for output_overwrite failed".to_string(),
inner: Box::new(e),
});
}
}
Expand Down Expand Up @@ -307,8 +307,8 @@ impl Action {
let file = fs::OpenOptions::new().write(true).create(true).open(v);
let file = file.map_err(|e| Error {
kind: ErrorKind::Config,
inner: Box::new(e),
message: "write to pipe file failed".to_string(),
inner: Box::new(e),
})?;
Pipe::File(file)
}
Expand Down
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ impl Profile {
pub fn from_toml(toml_str: &str) -> Result<Self, Error> {
Ok(Self::fit(toml::from_str(toml_str).map_err(|e| Error {
kind: ErrorKind::Config,
inner: Box::new(e),
message: "error while config file deserialize".to_string(),
inner: Box::new(e),
})?))
}

Expand Down
4 changes: 2 additions & 2 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ pub enum ErrorKind {
#[derive(Debug)]
pub struct Error {
pub kind: ErrorKind,
pub inner: Box<dyn fmt::Debug + Send + Sync>,
pub message: String,
pub inner: Box<dyn fmt::Debug + Send + Sync>,
}

impl Default for Error {
fn default() -> Self {
Self {
kind: ErrorKind::Other,
inner: Box::new(Option::<()>::None),
message: String::new(),
inner: Box::new(Option::<()>::None),
}
}
}
Expand Down

0 comments on commit 1cb8893

Please sign in to comment.