Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/handlebars_template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async fn main() {
// easily with others...
let hb = Arc::new(hb);

// Create a reusable closure to render template
// Create a reusable closure to render template - clone it for each map use
let handlebars = move |with_template| render(with_template, hb.clone());

//GET /
Expand All @@ -52,7 +52,7 @@ async fn main() {
name: "template.html",
value: json!({"user" : "Warp"}),
})
.map(handlebars);
.map(handlebars.clone());

warp::serve(route).run(([127, 0, 0, 1], 3030)).await;
}