mirror of
https://gitlab.cern.ch/wotsubo/endcap-sl-software-ri-generator.git
synced 2025-02-23 00:57:08 +09:00
refactor(generator): change CodeGenError name
This commit is contained in:
parent
122f7a4b3e
commit
34e1528745
1 changed files with 4 additions and 4 deletions
|
@ -28,8 +28,8 @@ use thiserror::Error;
|
|||
pub enum CodeGenError {
|
||||
#[error("tokenization(syn) error: {0}")]
|
||||
SynError(#[from] syn::Error),
|
||||
#[error("failed to create file: {0}")]
|
||||
FilePathError(String),
|
||||
#[error("failed to create file (name duplicated): {0}")]
|
||||
FilePathDuplicatedError(String),
|
||||
#[error("parent is required for {module}")]
|
||||
ParentMissing { module: &'static str },
|
||||
#[error("Unsupported structure: {}", name)]
|
||||
|
@ -373,7 +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::FilePathError(snake_case_name.to_string()));
|
||||
return Err(CodeGenError::FilePathDuplicatedError(snake_case_name.to_string()));
|
||||
};
|
||||
|
||||
let files = self.elements.into_iter().try_fold(files, |files, e| {
|
||||
|
@ -465,7 +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::FilePathError(snake_case_name.to_string()));
|
||||
return Err(CodeGenError::FilePathDuplicatedError(snake_case_name.to_string()));
|
||||
}
|
||||
Ok(files)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue