fn render_stdin(config: &RenderCommand, context: Context, writer: &mut Write) {
    log::debug!("Rendering template from standard input as no template files were passed...");
    let mut buffer = String::new();

    io::stdin().read_to_string(&mut buffer).unwrap_or_else(|e| {
        log::error!("Unable to read template from standard input: {}", e);
        process::exit(1);
    });

    match Tera::one_off(buffer.as_str(), context, config.autoescape) {
        Ok(s) => {
            write!(writer, "{}", s).unwrap_or_else(|e| {
                log::error!("Unable to write rendered template to output: {}", e);
                process::exit(1);
            });
        }
        Err(e) => {
            log::error!("Unable to render template from standard input: {:?}", e);
            process::exit(1);
        }
    }
}
/// Render the template present on standard input.
Render the template present on standard input.
Render the template present on standard input .
fn render_stdin(config: &RenderCommand, context: Context, writer: &mut Write) {
    log::debug!("Rendering template from standard input as no template files were passed...");
    let mut buffer = String::new();
    io::stdin().read_to_string(&mut buffer).unwrap_or_else(|e| {
        log::error!("Unable to read template from standard input: {}", e);
        process::exit(1);
    });
    match Tera::one_off(buffer.as_str(), context, config.autoescape) {
        Ok(s) => {
            write!(writer, "{}", s).unwrap_or_else(|e| {
                log::error!("Unable to write rendered template to output: {}", e);
                process::exit(1);
            });
        }
        Err(e) => {
            log::error!("Unable to render template from standard input: {:?}", e);
            process::exit(1);
        }
    }
}
fn render_stdin ( config : & RenderCommand , context : Context , writer : & mut Write ) { log :: debug ! ( " " ) ; let mut buffer = String :: new ( ) ; io :: stdin ( ) . read_to_string ( & mut buffer ) . unwrap_or_else ( | e | { log :: error ! ( " " e ) ; process :: exit ( 1 ) ; } ) ; match Tera :: one_off ( buffer . as_str ( ) , context , config . autoescape ) { Ok ( s ) => { write ! ( writer " " s ) . unwrap_or_else ( | e | { log :: error ! ( " " e ) ; process :: exit ( 1 ) ; } ) ; } Err ( e ) => { log :: error ! ( " " e ) ; process :: exit ( 1 ) ; } } }
Render the template present on standard input.
Render the template present on standard input .
config
&RenderCommand
context
Context
writer
&mut Write
config
&RenderCommand
context
Context
writer
&mut Write