Compare commits

..

No commits in common. "e62d935829da422afc928f5d9bca59df99466253" and "122f7a4b3e2091eb8fc3c291259711877dda156c" have entirely different histories.

View file

@ -28,8 +28,8 @@ use thiserror::Error;
pub enum CodeGenError {
#[error("tokenization(syn) error: {0}")]
SynError(#[from] syn::Error),
#[error("failed to create file (name duplicated): {0}")]
FilePathDuplicatedError(String),
#[error("failed to create file: {0}")]
FilePathError(String),
#[error("parent is required for {module}")]
ParentMissing { module: &'static str },
#[error("Unsupported structure: {}", name)]
@ -373,9 +373,7 @@ impl CodeGen for Block {
log::error!("path {}", out_path.display());
log::error!("old {}", old_out.to_string());
log::error!("new {}", out.to_string());
return Err(CodeGenError::FilePathDuplicatedError(
snake_case_name.to_string(),
));
return Err(CodeGenError::FilePathError(snake_case_name.to_string()));
};
let files = self.elements.into_iter().try_fold(files, |files, e| {
@ -467,9 +465,7 @@ impl CodeGen for Register {
let (out_path, _next_parent_path) = mod_file_path(parent_path, &snake_case_name);
log::info!("{:?}", out_path);
if files.insert(out_path, out).is_some() {
return Err(CodeGenError::FilePathDuplicatedError(
snake_case_name.to_string(),
));
return Err(CodeGenError::FilePathError(snake_case_name.to_string()));
}
Ok(files)
}