Strings have to be cloned

This commit is contained in:
Ana Gelez 2019-07-31 09:31:58 +02:00 committed by Igor Galić
parent 2dedcdbc53
commit fdc7da0edf
No known key found for this signature in database
GPG Key ID: ACFEFF7F6A123A86
2 changed files with 3 additions and 3 deletions

View File

@ -158,7 +158,7 @@ pub fn create(form: LenientForm<NewBlogForm>, rockets: PlumeRocket) -> RespondOr
let custom_domain = if *(&form.custom_domain.is_empty()) { let custom_domain = if *(&form.custom_domain.is_empty()) {
None None
} else { } else {
Some(Host::new(*(&form.custom_domain))) Some(Host::new(form.custom_domain.clone()))
}; };
let mut errors = match form.validate() { let mut errors = match form.validate() {

View File

@ -9,10 +9,10 @@
@:base(ctx, i18n!(ctx.1, "New Blog"), {}, {}, { @:base(ctx, i18n!(ctx.1, "New Blog"), {}, {}, {
<h1 dir="auto">@i18n!(ctx.1, "Create a blog")</h1> <h1 dir="auto">@i18n!(ctx.1, "Create a blog")</h1>
<form method="post" action="@uri!(blogs::create)"> <form method="post" action="@uri!(blogs::create)">
@input!(ctx.1, title (text), "Title", form, errors, "required minlength=\"1\"") @input!(ctx.1, title (text), "Title", form, errors.clone(), "required minlength=\"1\"")
<input type="submit" value="@i18n!(ctx.1, "Create blog")" dir="auto"/> <input type="submit" value="@i18n!(ctx.1, "Create blog")" dir="auto"/>
@input!(ctx.1, custom_domain (optional text), "Custom Domain", form, errors.clone(), "") @input!(ctx.1, custom_domain (optional text), "Custom Domain", form, errors, "")
<input type="submit" value="@i18n!(ctx.1, "Make your blog available under a custom domain")" dir="auto"/> <input type="submit" value="@i18n!(ctx.1, "Make your blog available under a custom domain")" dir="auto"/>
</form> </form>
}) })