Skip to content

directly output string instead of a function #117

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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