Fixup some errors

This commit is contained in:
Ana Hobden 2022-09-27 12:12:08 -07:00
parent b34a352753
commit db1d794cad

View file

@ -29,7 +29,6 @@ impl CreateDirectory {
if path.exists() && !force { if path.exists() && !force {
return Err(CreateDirectoryError::Exists( return Err(CreateDirectoryError::Exists(
path.to_path_buf(),
std::io::Error::new( std::io::Error::new(
std::io::ErrorKind::AlreadyExists, std::io::ErrorKind::AlreadyExists,
format!("Directory `{}` already exists", path.display()), format!("Directory `{}` already exists", path.display()),
@ -173,10 +172,8 @@ impl From<CreateDirectory> for Action {
#[derive(Debug, thiserror::Error, Serialize)] #[derive(Debug, thiserror::Error, Serialize)]
pub enum CreateDirectoryError { pub enum CreateDirectoryError {
#[error("Directory exists `{0}`")] #[error(transparent)]
Exists( Exists(
std::path::PathBuf,
#[source]
#[serde(serialize_with = "crate::serialize_error_to_display")] #[serde(serialize_with = "crate::serialize_error_to_display")]
std::io::Error, std::io::Error,
), ),