From fdc7da0edf812d1c2c5fddaeb7e6ec57b92ead0d Mon Sep 17 00:00:00 2001 From: Ana Gelez Date: Wed, 31 Jul 2019 09:31:58 +0200 Subject: [PATCH] Strings have to be cloned --- src/routes/blogs.rs | 2 +- templates/blogs/new.rs.html | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/routes/blogs.rs b/src/routes/blogs.rs index 53a3cc18..632138da 100644 --- a/src/routes/blogs.rs +++ b/src/routes/blogs.rs @@ -158,7 +158,7 @@ pub fn create(form: LenientForm, rockets: PlumeRocket) -> RespondOr let custom_domain = if *(&form.custom_domain.is_empty()) { None } else { - Some(Host::new(*(&form.custom_domain))) + Some(Host::new(form.custom_domain.clone())) }; let mut errors = match form.validate() { diff --git a/templates/blogs/new.rs.html b/templates/blogs/new.rs.html index 6a22f734..118d78a7 100644 --- a/templates/blogs/new.rs.html +++ b/templates/blogs/new.rs.html @@ -9,10 +9,10 @@ @:base(ctx, i18n!(ctx.1, "New Blog"), {}, {}, {

@i18n!(ctx.1, "Create a blog")

- @input!(ctx.1, title (text), "Title", form, errors, "required minlength=\"1\"") + @input!(ctx.1, title (text), "Title", form, errors.clone(), "required minlength=\"1\"") - @input!(ctx.1, custom_domain (optional text), "Custom Domain", form, errors.clone(), "") + @input!(ctx.1, custom_domain (optional text), "Custom Domain", form, errors, "")
})