diff --git a/Cargo.lock b/Cargo.lock index 4a2aa0a0..cc11b3c4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1536,9 +1536,9 @@ dependencies = [ [[package]] name = "if_chain" -version = "0.1.3" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bac95d9aa0624e7b78187d6fb8ab012b41d9f6f54b1bcb61e61c4845f8357ec" +checksum = "c3360c7b59e5ffa2653671fb74b4741a5d343c03f331c0a4aeda42b5c2b0ec7d" [[package]] name = "indexmap" @@ -3981,31 +3981,31 @@ dependencies = [ [[package]] name = "validator" -version = "0.8.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "236a5eda3df2c877872e98dbc55d497d943792e6405d8fc65bd4f8a5e3b53c99" +checksum = "7ab5990ba09102e1ddc954d294f09b9ea00fc7831a5813bbe84bfdbcae44051e" dependencies = [ - "idna 0.1.5", + "idna 0.2.0", "lazy_static", "regex", "serde", "serde_derive", "serde_json", - "url 1.7.2", + "url 2.1.1", ] [[package]] name = "validator_derive" -version = "0.8.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d360d6f5754972c0c1da14fb3d5580daa31aee566e1e45e2f8d3bf5950ecd3e9" +checksum = "e668e9cd05c5009b833833aa1147e5727b5396ea401f22dd1167618eed4a10c9" dependencies = [ "if_chain", "lazy_static", - "proc-macro2 0.4.30", - "quote 0.6.13", + "proc-macro2 1.0.17", + "quote 1.0.6", "regex", - "syn 0.15.44", + "syn 1.0.23", "validator", ] diff --git a/Cargo.toml b/Cargo.toml index fac4e204..cf0b4e40 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,8 +31,8 @@ serde_qs = "0.5" shrinkwraprs = "0.2.1" syntect = "3.3" tokio = "0.2" -validator = "0.8" -validator_derive = "0.8" +validator = "0.10" +validator_derive = "0.10" webfinger = { git = "https://github.com/Plume-org/webfinger", rev = "4e8f12810c4a7ba7a07bbcb722cd265fdff512b6", features = ["async"] } [[bin]] diff --git a/src/main.rs b/src/main.rs index 11f18c3e..5d44e5e7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,6 +9,7 @@ extern crate rocket; extern crate serde_json; #[macro_use] extern crate validator_derive; +extern crate validator; use clap::App; use diesel::r2d2::ConnectionManager; diff --git a/src/routes/comments.rs b/src/routes/comments.rs index 88f553c4..ca221054 100644 --- a/src/routes/comments.rs +++ b/src/routes/comments.rs @@ -22,7 +22,7 @@ use plume_models::{ #[derive(Default, FromForm, Debug, Validate)] pub struct NewCommentForm { pub responding_to: Option, - #[validate(length(min = "1", message = "Your comment can't be empty"))] + #[validate(length(min = 1, message = "Your comment can't be empty"))] pub content: String, pub warning: String, } diff --git a/src/routes/instance.rs b/src/routes/instance.rs index 055ac123..74887e48 100644 --- a/src/routes/instance.rs +++ b/src/routes/instance.rs @@ -77,12 +77,12 @@ pub fn admin_mod(_mod: Moderator, rockets: PlumeRocket) -> Ructe { #[derive(Clone, FromForm, Validate)] pub struct InstanceSettingsForm { - #[validate(length(min = "1"))] + #[validate(length(min = 1))] pub name: String, pub open_registrations: bool, pub short_description: SafeString, pub long_description: SafeString, - #[validate(length(min = "1"))] + #[validate(length(min = 1))] pub default_license: String, } diff --git a/src/routes/session.rs b/src/routes/session.rs index 5f65ddf8..5757a1f5 100644 --- a/src/routes/session.rs +++ b/src/routes/session.rs @@ -35,9 +35,9 @@ pub fn new(m: Option, rockets: PlumeRocket) -> Ructe { #[derive(Default, FromForm, Validate)] pub struct LoginForm { - #[validate(length(min = "1", message = "We need an email, or a username to identify you"))] + #[validate(length(min = 1, message = "We need an email, or a username to identify you"))] pub email_or_name: String, - #[validate(length(min = "1", message = "Your password can't be empty"))] + #[validate(length(min = 1, message = "Your password can't be empty"))] pub password: String, } @@ -199,7 +199,7 @@ pub fn password_reset_form(token: String, rockets: PlumeRocket) -> Result