pub fn get_or_create_template_path<T: AsScriptFullTypeRef>(
    ty: &T,
    force: bool,
    check_subtype: bool
) -> Result<(PathBuf, Option<&'static str>)>
Expand description

check_subtype 是為避免太容易生出子模版

Examples found in repository?
src/util/mod.rs (line 178)
173
174
175
176
177
178
179
180
181
182
183
pub fn get_or_create_template<T: AsScriptFullTypeRef>(
    ty: &T,
    force: bool,
    check_subtype: bool,
) -> Result<String> {
    let (tmpl_path, default_tmpl) = get_or_create_template_path(ty, force, check_subtype)?;
    if let Some(default_tmpl) = default_tmpl {
        return Ok(default_tmpl.to_owned());
    }
    read_file(&tmpl_path)
}