Use macros for the intermediate to render step.
This is largely to make changing the type signature of these functions easier by significantly reducing the amount of places that duplicates the signature.
This commit is contained in:
@@ -6,6 +6,8 @@ use crate::config::Config;
|
||||
use crate::error::CustomError;
|
||||
use crate::intermediate::ISrcBlock;
|
||||
|
||||
use super::macros::render;
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
#[serde(tag = "type")]
|
||||
#[serde(rename = "src_block")]
|
||||
@@ -13,15 +15,16 @@ pub(crate) struct RenderSrcBlock {
|
||||
lines: Vec<String>,
|
||||
}
|
||||
|
||||
impl RenderSrcBlock {
|
||||
pub(crate) fn new(
|
||||
_config: &Config,
|
||||
_output_directory: &Path,
|
||||
_output_file: &Path,
|
||||
original: &ISrcBlock,
|
||||
) -> Result<RenderSrcBlock, CustomError> {
|
||||
render!(
|
||||
RenderSrcBlock,
|
||||
ISrcBlock,
|
||||
original,
|
||||
config,
|
||||
output_directory,
|
||||
output_file,
|
||||
{
|
||||
Ok(RenderSrcBlock {
|
||||
lines: original.lines.clone(),
|
||||
})
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user