Skip to content

directly output string instead of a function #117

@prabirshrestha

Description

@prabirshrestha

Is it possible to add a feature such that templates to return string instead of function if the feature flag is enabled This makes it easy to onboard to new frameworks. More info at salvo-rs/salvo#147 (comment).

// current
let mut buf = Vec::new();
templates::hello(&mut buf, "world");
response.render(buf);

// new
response.render(templates::hello_world_str("world"));

//cc @chrislearn

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions