Skip to content

Commit

Permalink
clone in outer closure
Browse files Browse the repository at this point in the history
  • Loading branch information
bburdette committed Sep 12, 2019
1 parent c8a8726 commit acf97fe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/webserver.rs
Expand Up @@ -31,10 +31,11 @@ pub fn startwebserver<'a>(
let shtml: String = htmltemp.replace("{{websockets-port}}", &websockets_port);
{
let s = server::new(move || {
let meh = shtml.clone();
App::new()
.resource(r"/static/{tail:.*}", |r| r.method(Method::GET).f(files))
.resource(r"/{tail:.*}", move |r| {
r.method(Method::GET).f(mainpage(shtml.clone()))
r.method(Method::GET).f(mainpage(meh))
})
});

Expand Down

0 comments on commit acf97fe

Please sign in to comment.