pub fn template_reader(template_name: &str) -> Option<String> {
    // note: this function exists as a proxy to the cached version of read_template
    // we can't cache functions with &str values, but we can cache methods with string input
    let template_file = get_template_path(template_name);
    if Path::new(&template_file).exists() {
        debug!("Found template file");
        // Path exists, read template and return
        Some(read_template(template_name.to_string()))
    } else {
        debug!(
            "No template file {}",
            template_file.into_os_string().into_string().unwrap()
        );
        None
    }
}
/// Reads a template file with name `template_name`
/// Returns the template content as a string
Reads a template file with name `template_name`
Returns the template content as a string
Reads a template file with name ` template_name ` Returns the template content as a string
pub fn template_reader(template_name: &str) -> Option<String> {
    // note: this function exists as a proxy to the cached version of read_template
    // we can't cache functions with &str values, but we can cache methods with string input
    let template_file = get_template_path(template_name);
    if Path::new(&template_file).exists() {
        debug!("Found template file");
        // Path exists, read template and return
        Some(read_template(template_name.to_string()))
    } else {
        debug!(
            "No template file {}",
            template_file.into_os_string().into_string().unwrap()
        );
        None
    }
}
pub fn template_reader ( template_name : & str ) -> Option < String > { // note: this function exists as a proxy to the cached version of read_template // we can't cache functions with &str values, but we can cache methods with string input let template_file = get_template_path ( template_name ) ; if Path :: new ( & template_file ) . exists ( ) { debug ! ( " " ) ; // Path exists, read template and return Some ( read_template ( template_name . to_string ( ) ) ) } else { debug ! ( " " template_file into_os_string ( ) into_string ( ) unwrap ( ) ) ; None } }
Reads a template file with name `template_name`
Returns the template content as a string
Reads a template file with name ` template_name ` Returns the template content as a string
template_name
&str
template_name
&str