Remove some unused #[derive] (#473)

We used to need them, probably when we were using Tera.
This commit is contained in:
Baptiste Gelez
2019-03-12 19:40:54 +01:00
committed by GitHub
parent 6405bd7261
commit 42dca3daae
24 changed files with 23 additions and 37 deletions
-2
View File
@@ -30,8 +30,6 @@ extern crate rocket_i18n;
extern crate scheduled_thread_pool;
extern crate serde;
#[macro_use]
extern crate serde_derive;
#[macro_use]
extern crate serde_json;
extern crate serde_qs;
extern crate validator;
+1 -1
View File
@@ -66,7 +66,7 @@ pub fn new_auth(i18n: I18n) -> Flash<Redirect>{
)
}
#[derive(Default, FromForm, Validate, Serialize)]
#[derive(Default, FromForm, Validate)]
pub struct NewBlogForm {
#[validate(custom(function = "valid_slug", message = "Invalid name"))]
pub title: String,
+1 -1
View File
@@ -25,7 +25,7 @@ use plume_models::{
use Worker;
use routes::errors::ErrorPage;
#[derive(Default, FromForm, Debug, Validate, Serialize)]
#[derive(Default, FromForm, Debug, Validate)]
pub struct NewCommentForm {
pub responding_to: Option<i32>,
#[validate(length(min = "1", message = "Your comment can't be empty"))]
+1 -1
View File
@@ -103,7 +103,7 @@ pub fn admin(conn: DbConn, admin: Admin, intl: I18n) -> Result<Ructe, ErrorPage>
)))
}
#[derive(Clone, FromForm, Validate, Serialize)]
#[derive(Clone, FromForm, Validate)]
pub struct InstanceSettingsForm {
#[validate(length(min = "1"))]
pub name: String,
+1 -1
View File
@@ -272,7 +272,7 @@ pub fn update(blog: String, slug: String, user: User, cl: ContentLen, form: Leni
}
}
#[derive(Default, FromForm, Validate, Serialize)]
#[derive(Default, FromForm, Validate)]
pub struct NewPostForm {
#[validate(custom(function = "valid_slug", message = "Invalid title"))]
pub title: String,
+1 -1
View File
@@ -29,7 +29,7 @@ pub fn new(user: Option<User>, conn: DbConn, m: Option<String>, intl: I18n) -> R
))
}
#[derive(Default, FromForm, Validate, Serialize)]
#[derive(Default, FromForm, Validate)]
pub struct LoginForm {
#[validate(length(min = "1", message = "We need an email or a username to identify you"))]
pub email_or_name: String,
+1 -1
View File
@@ -276,7 +276,7 @@ pub fn delete(name: String, conn: DbConn, user: User, mut cookies: Cookies, sear
}
}
#[derive(Default, FromForm, Serialize, Validate)]
#[derive(Default, FromForm, Validate)]
#[validate(
schema(
function = "passwords_match",