commit_hash stringlengths 40 40 | author stringlengths 1 57 | date timestamp[s]date 2010-07-26 04:45:09 2026-04-14 18:21:10 | message stringlengths 8 1.39M | diff stringlengths 68 51.2k | files_changed int64 1 136 | insertions int64 0 2.35k | deletions int64 0 1.9k |
|---|---|---|---|---|---|---|---|
c580832239b1b05bcc130ee17a67c26c6dcbc47a | Corey Farwell | 2016-03-26T18:33:05 | Add test for passing invalid character to `from_hex`. | diff --git a/src/lib.rs b/src/lib.rs
index ad1bf75..75bf578 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -128,6 +128,15 @@ mod test {
FromHexError::InvalidHexLength);
}
+ #[test]
+ pub fn test_invalid_char() {
+ assert_eq!(Vec::from_hex("66ag").unwrap_err(),
+ Fr... | 1 | 9 | 0 |
d9a335580e2965a760c8a00b8c9b1173eeecae06 | Corey Farwell | 2016-03-26T18:23:40 | Add test for passing zero length to `from_hex`. | diff --git a/src/lib.rs b/src/lib.rs
index f481fd7..ad1bf75 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -127,4 +127,9 @@ mod test {
assert_eq!(Vec::from_hex("666f6f6261721").unwrap_err(),
FromHexError::InvalidHexLength);
}
+
+ #[test]
+ pub fn test_empty() {
+ assert_eq!(V... | 1 | 5 | 0 |
aa85a16fe61458c666a897a5c444e0fa906cb280 | Corey Farwell | 2016-03-26T18:21:42 | Add test for passing odd numbered hex length to `from_hex`. | diff --git a/src/lib.rs b/src/lib.rs
index 5f5c8b5..f481fd7 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -105,7 +105,7 @@ impl FromHex for Vec<u8> {
#[cfg(test)]
mod test {
- use super::{FromHex, ToHex};
+ use super::{FromHex, FromHexError, ToHex};
#[test]
fn test_to_hex() {
@@ -119,4 +119,12 @@ mo... | 1 | 9 | 1 |
98040a185d651cbcec843c79174f85209200d0b8 | Corey Farwell | 2016-03-26T18:20:39 | `FromHexError` should derive `PartialEq`.
This will make error comparisons easy via `==`. | diff --git a/src/lib.rs b/src/lib.rs
index 8144f14..5f5c8b5 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -26,7 +26,7 @@ impl<T: AsRef<[u8]>> ToHex for T {
}
}
-#[derive(Debug, Clone, Copy)]
+#[derive(Debug, Clone, Copy, PartialEq)]
pub enum FromHexError {
InvalidHexCharacter {
c: char, | 1 | 1 | 1 |
3894b8fa6c389d96f14597c40aed5ff2d793987f | KokaKiwi | 2015-10-23T05:46:10 | Complete Cargo.toml | diff --git a/Cargo.toml b/Cargo.toml
index e76d970..061a2da 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -2,3 +2,8 @@
name = "hex"
version = "0.1.0"
authors = ["KokaKiwi <kokakiwi@kokakiwi.net>"]
+description = "A basic crate to encode values to hexadecimal representation."
+license = "MIT"
+homepage = "https://githu... | 1 | 5 | 0 |
49d2a4e8242be4d73058e9f5823b50d567b38b17 | Colin Watson | 2026-04-12T18:21:12 | Fix email address syntax (#392)
This looked like an accident. | diff --git a/validator/Cargo.toml b/validator/Cargo.toml
index a61f5ed..7ad7fa4 100644
--- a/validator/Cargo.toml
+++ b/validator/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "validator"
version = "0.20.0"
-authors = ["Vincent Prouillet <hello@vincentprouillet.com"]
+authors = ["Vincent Prouillet <hello@vincentprouil... | 2 | 2 | 2 |
874be994e8c9a77c19e971ffe3a9560129b529f0 | FalkWoldmann | 2025-03-07T09:45:59 | Remove the once_cell dependency (#373)
* Remove once_cell crate
* Remove once_cell in tests as well
* Remove remaining references
* Apply default lints | diff --git a/validator/Cargo.toml b/validator/Cargo.toml
index 152655d..a61f5ed 100644
--- a/validator/Cargo.toml
+++ b/validator/Cargo.toml
@@ -14,7 +14,6 @@ rust-version = { workspace = true }
[dependencies]
url = "2"
regex = { version = "1", default-features = false, features = ["std"] }
-once_cell = "1.18.0"
id... | 12 | 38 | 57 |
06e69ebe27655329b2eda4ec1d410612da4c0103 | Ifiok Jr. | 2025-01-20T11:35:12 | feat: support `Deserialize` for `ValidationErrors` (#364)
Use `Cow<'static, str>` as suggested in
https://github.com/Keats/validator/issues/358. | diff --git a/validator/src/traits.rs b/validator/src/traits.rs
index 790ed26..123eaf7 100644
--- a/validator/src/traits.rs
+++ b/validator/src/traits.rs
@@ -1,4 +1,5 @@
use crate::types::{ValidationErrors, ValidationErrorsKind};
+use std::borrow::Cow;
use std::collections::btree_map::BTreeMap;
use std::collections::... | 6 | 34 | 27 |
6f22a170edf3d727a634f99f87cc0eb921517dba | Gabriel Lopes Veiga | 2024-11-03T22:00:08 | Fix warnings in tests (#355) | diff --git a/validator/tests/display.rs b/validator/tests/display.rs
index e6bfa66..1423e60 100644
--- a/validator/tests/display.rs
+++ b/validator/tests/display.rs
@@ -1,4 +1,4 @@
-#[cfg(derive)]
+#[cfg(feature = "derive")]
mod tests {
use validator::Validate;
@@ -17,13 +17,13 @@ mod tests {
#[derive(Va... | 2 | 8 | 8 |
2ff6d0c762b0d689e3724167347f046397f9237e | Vincent Prouillet | 2024-08-27T17:52:38 | New version for derive | diff --git a/validator_derive/Cargo.toml b/validator_derive/Cargo.toml
index e31089a..bf46cd4 100644
--- a/validator_derive/Cargo.toml
+++ b/validator_derive/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "validator_derive"
-version = "0.18.1"
+version = "0.18.2"
authors = ["Vincent Prouillet <hello@vincentprouillet.co... | 1 | 1 | 1 |
411bc9f15fb39b37c4fd68cbea19a42419392233 | Kailokk | 2024-08-21T13:09:02 | Add ValidateRegex Implementation For Box, Rc, and Arc (#348)
* Add ValidateRegex Implementation For Box, Rc, and Arc
* Remove unecessary import
* Remove unintended extra line
* Implement Validate Regex For Str | diff --git a/validator/src/validation/regex.rs b/validator/src/validation/regex.rs
index 59271c4..1668f08 100644
--- a/validator/src/validation/regex.rs
+++ b/validator/src/validation/regex.rs
@@ -1,5 +1,6 @@
use std::borrow::Cow;
use std::cell::OnceCell;
+use std::rc::Rc;
use std::sync::{Arc, Mutex, OnceLock};
u... | 1 | 25 | 0 |
ecc5235be323fdda676e75f3bc090e864af2ad49 | naskya | 2024-08-05T18:58:48 | fix: check the name of #[foo] (name only) attributes (#340) (#345) | diff --git a/validator_derive/src/types.rs b/validator_derive/src/types.rs
index e1580c4..c34da3d 100644
--- a/validator_derive/src/types.rs
+++ b/validator_derive/src/types.rs
@@ -77,7 +77,7 @@ impl ValidateField {
let field_name = self.ident.clone().expect("Field is not a named field").to_string();
... | 1 | 1 | 1 |
9a5880ce28bd94fa42e5e92bb91fdaf17475b7c0 | Thomas Vincent | 2024-07-25T09:07:46 | fix: darling unexpected literal type error (#327) | diff --git a/validator_derive/src/lib.rs b/validator_derive/src/lib.rs
index 16fcf5e..e707e0e 100644
--- a/validator_derive/src/lib.rs
+++ b/validator_derive/src/lib.rs
@@ -242,7 +242,7 @@ impl ToTokens for ValidateField {
// The "supports(struct_named)" attribute guarantees only named structs to work with this macro
... | 1 | 1 | 1 |
a7c5bd5501391b60a19547332279d4b913bccc6e | Felix Prasse | 2024-07-21T18:12:52 | Publish AsRegex trait so that users can implement the ValidateRegex trait. (#329) | diff --git a/validator/src/lib.rs b/validator/src/lib.rs
index 463ec7f..6346a7c 100644
--- a/validator/src/lib.rs
+++ b/validator/src/lib.rs
@@ -76,7 +76,7 @@ pub use validation::must_match::validate_must_match;
#[cfg(feature = "unic")]
pub use validation::non_control_character::ValidateNonControlCharacter;
pub use ... | 1 | 1 | 1 |
fab9ceda8358760282752e715cd2cff022b39f38 | Johannes Löthberg | 2024-04-10T19:28:44 | Fix broken support for nested validation with multiple errors (#321)
Fixes #319.
Signed-off-by: Johannes Löthberg <johannes.loethberg@elokon.com> | diff --git a/validator/src/types.rs b/validator/src/types.rs
index 30b236a..861f2d2 100644
--- a/validator/src/types.rs
+++ b/validator/src/types.rs
@@ -72,17 +72,16 @@ impl ValidationErrors {
) -> &mut ValidationErrors {
match child {
Ok(()) => self,
- Err(errors) => {
- ... | 2 | 51 | 10 |
ba8a9b9398f60df9066de8ec742ff9a319792106 | Vincent Prouillet | 2024-04-05T13:11:04 | its v0.18.0 | diff --git a/validator/Cargo.toml b/validator/Cargo.toml
index 650892f..da2e53f 100644
--- a/validator/Cargo.toml
+++ b/validator/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "validator"
-version = "0.17.0"
+version = "0.18.0"
authors = ["Vincent Prouillet <hello@vincentprouillet.com"]
license = "MIT"
description =... | 3 | 4 | 4 |
3d202fe7700bbcc410a63b9c948c663ec7f9b027 | Johannes Löthberg | 2024-03-29T08:35:24 | Fix custom functions for optional number types (#315)
* Dynamically build the list of number types
Round-tripping these through `quote!().to_token_stream().to_string()`
lets us ensure that the resulting strings always match.
Signed-off-by: Johannes Löthberg <johannes.loethberg@elokon.com>
* Don't destructure... | diff --git a/validator_derive/Cargo.toml b/validator_derive/Cargo.toml
index e0a0dfe..feab77c 100644
--- a/validator_derive/Cargo.toml
+++ b/validator_derive/Cargo.toml
@@ -19,3 +19,4 @@ quote = "1"
proc-macro2 = "1"
proc-macro-error = "1"
darling = { version = "0.20", features = ["suggestions"] }
+once_cell = "1.18... | 4 | 79 | 51 |
dc8cf0235a953709aa45ec0930c4a329a8b129fa | Vincent Prouillet | 2024-03-26T22:28:48 | Add back smarter arguments for custom | diff --git a/validator/src/traits.rs b/validator/src/traits.rs
index bf980ec..790ed26 100644
--- a/validator/src/traits.rs
+++ b/validator/src/traits.rs
@@ -51,27 +51,25 @@ impl_validate_list!(std::vec::Vec<T>);
impl_validate_list!([T]);
impl<T: Validate, const N: usize> Validate for [T; N] {
-fn validate(&self) ->... | 6 | 82 | 65 |
59a97b3961d961a123603ed8d38b293b2f721f97 | Vincent Prouillet | 2024-03-18T21:19:35 | Restore behaviour of custom fns
Fixes #310 | diff --git a/validator_derive/src/lib.rs b/validator_derive/src/lib.rs
index 902df53..606918e 100644
--- a/validator_derive/src/lib.rs
+++ b/validator_derive/src/lib.rs
@@ -182,11 +182,14 @@ impl ToTokens for ValidateField {
// Custom validation
let mut custom = quote!();
for c in &self.custo... | 4 | 12 | 10 |
96f758158684b0816b0bebaf9f469eff3e53980d | Vincent Prouillet | 2024-03-11T18:50:41 | Remove warning from test | diff --git a/validator_derive_tests/tests/run-pass/optional_field.rs b/validator_derive_tests/tests/run-pass/optional_field.rs
index 782adbb..d08eb59 100644
--- a/validator_derive_tests/tests/run-pass/optional_field.rs
+++ b/validator_derive_tests/tests/run-pass/optional_field.rs
@@ -3,7 +3,7 @@ use validator::{Validat... | 1 | 1 | 1 |
0155e6c4bd6f8ddc66cb54987b56b2e9e6b7c568 | Vincent Prouillet | 2024-03-09T23:07:40 | Attempt to fix everything | diff --git a/Cargo.toml b/Cargo.toml
index 35b694f..5e1c7b4 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,3 +1,3 @@
[workspace]
resolver = "2"
-members = ["validator", "validator_derive", "validator_derive_tests", "testing-bugs"]
+members = ["validator", "validator_derive", "validator_derive_tests"]
diff --git a/val... | 7 | 38 | 36 |
53f22b8145b8fba3450ce5dcb6fe133970a11406 | Yiyu Lin | 2024-03-09T23:09:27 | fix: derive missed the `Result` (#296)
Co-authored-by: hzlinyiyu <hzlinyiyu@corp.netease.com> | diff --git a/validator_derive/src/lib.rs b/validator_derive/src/lib.rs
index 3489f56..ecb6fc4 100644
--- a/validator_derive/src/lib.rs
+++ b/validator_derive/src/lib.rs
@@ -370,7 +370,7 @@ pub fn derive_validation(input: proc_macro::TokenStream) -> proc_macro::TokenStr
let argless_validation = if validation_data.c... | 1 | 1 | 1 |
1ddaf69bf1ca2004f1f2f33058ccc435fa1d3bad | jobs62 | 2024-03-09T12:21:19 | test: add test for default type pamameters (#300)
Co-authored-by: Ch.-David Blot <charles-david.blot@orange.com> | diff --git a/validator_derive_tests/tests/run-pass/default_struct_parameters.rs b/validator_derive_tests/tests/run-pass/default_struct_parameters.rs
new file mode 100644
index 0000000..c11ffca
--- /dev/null
+++ b/validator_derive_tests/tests/run-pass/default_struct_parameters.rs
@@ -0,0 +1,8 @@
+use validator::Validate... | 1 | 8 | 0 |
503216ccf89acae1f6670d9457aa5978509d8869 | Einar | 2024-03-06T10:05:02 | Nested collections should not always fail (#301) | diff --git a/validator/src/validation/nested.rs b/validator/src/validation/nested.rs
index 584f649..faffa4b 100644
--- a/validator/src/validation/nested.rs
+++ b/validator/src/validation/nested.rs
@@ -62,12 +62,11 @@ where
}
}
- let err_kind = ValidationErrorsKind::List(vec_err);
- ... | 2 | 80 | 20 |
5137cea2ba05a55817f3bfc49c33e0498e7e0221 | Vincent Prouillet | 2024-03-04T09:22:07 | Update idna | diff --git a/validator/Cargo.toml b/validator/Cargo.toml
index fbc02ea..650892f 100644
--- a/validator/Cargo.toml
+++ b/validator/Cargo.toml
@@ -14,7 +14,7 @@ readme = "../README.md"
url = "2"
regex = { version = "1", default-features = false, features = ["std"] }
once_cell = "1.18.0"
-idna = "0.4"
+idna = "0.5"
se... | 1 | 1 | 1 |
d2d3223e61fb37ead97cbb9de8ffe5b124a3d23f | Vincent Prouillet | 2024-03-04T09:20:32 | Ready for release | diff --git a/validator/Cargo.toml b/validator/Cargo.toml
index 545e8a6..fbc02ea 100644
--- a/validator/Cargo.toml
+++ b/validator/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "validator"
-version = "0.16.1"
+version = "0.17.0"
authors = ["Vincent Prouillet <hello@vincentprouillet.com"]
license = "MIT"
description =... | 3 | 4 | 4 |
9519689266ce3fce76d3d56bdbe046b32ef2e9f7 | decryphe | 2023-11-13T09:33:21 | Enables setting custom messages in complex custom validation functions (#279)
Co-authored-by: decryphe <noreply@github.com> | diff --git a/validator/src/types.rs b/validator/src/types.rs
index 3bbbf1f..9b5ede9 100644
--- a/validator/src/types.rs
+++ b/validator/src/types.rs
@@ -20,6 +20,13 @@ impl ValidationError {
pub fn add_param<T: Serialize>(&mut self, name: Cow<'static, str>, val: &T) {
self.params.insert(name, to_value(val... | 1 | 7 | 0 |
11cc0e92ac649596eeb053183cde2d76b9a397fd | future-highway | 2023-10-10T20:53:05 | Use generics and macros (#274)
* Reduce boilerplate code using generics and macros
* Remove `HasLen`
Plus a couple of clippy suggestions | diff --git a/validator/src/lib.rs b/validator/src/lib.rs
index da38576..e1b7dd7 100644
--- a/validator/src/lib.rs
+++ b/validator/src/lib.rs
@@ -82,7 +82,7 @@ pub use validation::regex::ValidateRegex;
pub use validation::required::ValidateRequired;
pub use validation::urls::ValidateUrl;
-pub use traits::{HasLen, Va... | 9 | 160 | 931 |
df6e5f55a0856ac8774df462f3714cba42b1d506 | Jakub Jirutka | 2023-07-25T21:09:58 | Disable unnecessary/unused regex features (#261)
* Avoid unnecessary case-insensitive regexes
The case-insensitive flag `(?i)` requires regex with the unicode-case
feature enabled which significantly increases the binary size and makes
regex slower.
* Disable unnecessary/unused regex features
regex crate wi... | diff --git a/validator/Cargo.toml b/validator/Cargo.toml
index 6773d19..d44fa1f 100644
--- a/validator/Cargo.toml
+++ b/validator/Cargo.toml
@@ -12,7 +12,7 @@ readme = "../README.md"
[dependencies]
url = "2"
-regex = "1"
+regex = { version = "1", default-features = false, features = ["std"] }
lazy_static = "1"
id... | 3 | 5 | 5 |
0271e9596f1b140c85b9280ddd525cb6d784bd59 | Johannes Löthberg | 2023-06-01T16:06:18 | Switch non-control-character validator to a trait (#257) | diff --git a/validator/src/lib.rs b/validator/src/lib.rs
index 913a2b1..863a347 100644
--- a/validator/src/lib.rs
+++ b/validator/src/lib.rs
@@ -75,7 +75,9 @@ pub use validation::ip::{validate_ip, validate_ip_v4, validate_ip_v6};
pub use validation::length::{validate_length, ValidateLength};
pub use validation::must_... | 5 | 49 | 23 |
22d57e4c9b33be62f86f56a3158235d8c4fce74e | Johannes Löthberg | 2023-05-30T11:18:56 | Switch credit card validator to a trait (#256) | diff --git a/validator/src/lib.rs b/validator/src/lib.rs
index 89070f9..913a2b1 100644
--- a/validator/src/lib.rs
+++ b/validator/src/lib.rs
@@ -67,7 +67,7 @@ mod types;
mod validation;
#[cfg(feature = "card")]
-pub use validation::cards::validate_credit_card;
+pub use validation::cards::{validate_credit_card, Vali... | 4 | 53 | 6 |
fbd0992aeb4ea9957f24488af8ad32265e0d1b80 | Vincent Prouillet | 2023-05-13T01:46:38 | Remove phone feature and code | diff --git a/validator/Cargo.toml b/validator/Cargo.toml
index b7b5e3f..6773d19 100644
--- a/validator/Cargo.toml
+++ b/validator/Cargo.toml
@@ -20,13 +20,11 @@ serde_derive = "1"
serde_json = "1"
validator_derive = { version = "0.16", path = "../validator_derive", optional = true }
card-validate = { version = "2.2"... | 10 | 3 | 157 |
60c3b94cbfb7566bc86cfc60e9323815e1c12062 | Vincent Prouillet | 2023-05-13T01:44:37 | Change some trait + cargo fmt | diff --git a/validator/src/validation/email.rs b/validator/src/validation/email.rs
index 38b55f8..0b386eb 100644
--- a/validator/src/validation/email.rs
+++ b/validator/src/validation/email.rs
@@ -77,30 +77,12 @@ pub trait ValidateEmail {
true
}
- fn to_email_string<'a>(&'a self) -> Cow<'a, str>;
+ ... | 5 | 105 | 147 |
3f373b696896951ec91439215385ab92a79627bd | pintariching | 2023-04-14T10:50:00 | Trait validation (#225)
* implemented validation trait for length
* converted identation to spaces
* changed the trait to not require HasLen
* added macro for generating impls
* implemented ValidateLength for some types
* using trait validation instead of the function
* added cfg for indexmap import
... | diff --git a/validator/src/lib.rs b/validator/src/lib.rs
index ca71b3b..e4fc52d 100644
--- a/validator/src/lib.rs
+++ b/validator/src/lib.rs
@@ -73,18 +73,18 @@ mod validation;
pub use validation::cards::validate_credit_card;
pub use validation::contains::validate_contains;
pub use validation::does_not_contain::vali... | 11 | 520 | 76 |
6a89bde8f67ed4a879c9eec0542f18e29a56bac8 | Vincent Prouillet | 2023-06-15T18:19:55 | Update dep (#258) | diff --git a/validator/Cargo.toml b/validator/Cargo.toml
index 341b950..b7b5e3f 100644
--- a/validator/Cargo.toml
+++ b/validator/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "validator"
-version = "0.16.0"
+version = "0.16.1"
authors = ["Vincent Prouillet <hello@vincentprouillet.com"]
license = "MIT"
description =... | 1 | 2 | 2 |
9e2ee20117de889c8b2b6294afc126a2d8312d03 | Oliver Gould | 2023-06-15T18:15:07 | Update idna to v0.3 (#233)
There's a new version of the idna crate. | diff --git a/validator/Cargo.toml b/validator/Cargo.toml
index 5c69bd1..341b950 100644
--- a/validator/Cargo.toml
+++ b/validator/Cargo.toml
@@ -14,7 +14,7 @@ readme = "../README.md"
url = "2"
regex = "1"
lazy_static = "1"
-idna = "0.2"
+idna = "0.3"
serde = "1"
serde_derive = "1"
serde_json = "1" | 1 | 1 | 1 |
a001213e42055b2aa8b034cd3f34121c208c3b2f | Rinat Shigapov | 2022-07-08T20:21:23 | allow single_use_lifetimes lint (#223) | diff --git a/validator_derive/src/lib.rs b/validator_derive/src/lib.rs
index afdf0ef..1c3a536 100644
--- a/validator_derive/src/lib.rs
+++ b/validator_derive/src/lib.rs
@@ -72,6 +72,9 @@ fn impl_validate(ast: &syn::DeriveInput) -> proc_macro2::TokenStream {
// We need this here to prevent formatting lints that... | 1 | 3 | 0 |
4cd1401c48b1a6b208c142166da14ed579ccd442 | Tuetuopay | 2022-07-08T20:18:04 | feat(traits): impl HasLen for &[T] and [T; N] (#222)
Co-authored-by: Alexis Bauvin <abauvin@scaleway.com> | diff --git a/validator/src/traits.rs b/validator/src/traits.rs
index a378b88..05378bc 100644
--- a/validator/src/traits.rs
+++ b/validator/src/traits.rs
@@ -50,6 +50,24 @@ impl<'a, T> HasLen for &'a Vec<T> {
}
}
+impl<T> HasLen for &[T] {
+ fn length(&self) -> u64 {
+ self.len() as u64
+ }
+}
+
+im... | 2 | 65 | 0 |
2f8c040b629054b1b0c0675eba53cd6aa429d6fe | pintariching | 2022-06-27T07:42:51 | Email length validation before regex (#211)
* added email length validation before doing regex
* removed if check I forgot about | diff --git a/validator/src/validation/email.rs b/validator/src/validation/email.rs
index 96398fc..e5aab3b 100644
--- a/validator/src/validation/email.rs
+++ b/validator/src/validation/email.rs
@@ -3,7 +3,7 @@ use lazy_static::lazy_static;
use regex::Regex;
use std::borrow::Cow;
-use crate::validation::ip::validate_... | 1 | 19 | 1 |
f17bc740db0aed655ca3bd917cace814c4749e7b | Jean-Baptiste Trystram | 2022-06-03T20:57:09 | ship readme to crates.io (#216) | diff --git a/validator/Cargo.toml b/validator/Cargo.toml
index c569fee..0d94358 100644
--- a/validator/Cargo.toml
+++ b/validator/Cargo.toml
@@ -8,6 +8,7 @@ homepage = "https://github.com/Keats/validator"
repository = "https://github.com/Keats/validator"
keywords = ["validation", "api", "validator"]
edition = "2018"... | 3 | 3 | 0 |
f0727e0474a3f7f2e26c666e71f667c4ac2c8e89 | Rakshith Ravi | 2022-05-24T07:11:39 | Added clippy suggestions (#215)
* Added clippy suggestions
* Updated failing tests for changes to assert! | diff --git a/validator/src/validation/cards.rs b/validator/src/validation/cards.rs
index 5c6ea95..df3929b 100644
--- a/validator/src/validation/cards.rs
+++ b/validator/src/validation/cards.rs
@@ -33,12 +33,12 @@ mod tests {
#[test]
fn test_credit_card_cow() {
let test: Cow<'static, str> = "453957114... | 14 | 69 | 70 |
89919c94524fe2f2a62e7683d0eb1aa92d9757af | Ross Lannen | 2022-05-03T07:43:26 | Remove validator_types dep from main validator crate. (#206)
This removes the transitive dependency on proc_macro, allowing the
crate to be cross compiled when a target proc_macro is not available. | diff --git a/validator/Cargo.toml b/validator/Cargo.toml
index a2f129f..721720f 100644
--- a/validator/Cargo.toml
+++ b/validator/Cargo.toml
@@ -17,7 +17,6 @@ idna = "0.2"
serde = "1"
serde_derive = "1"
serde_json = "1"
-validator_types = { version = "0.14", path = "../validator_types" }
validator_derive = { versio... | 3 | 3 | 7 |
7e85875ea39a59f829166c701615445775533fdd | Kamil Rojewski | 2022-04-05T11:23:09 | Better support for maps (#203)
* generalized trait impl for HashMap and HashSet
* support for nested map validation
* properly quoting nested map field
* map nested validation tests | diff --git a/validator/src/traits.rs b/validator/src/traits.rs
index 03786b5..a378b88 100644
--- a/validator/src/traits.rs
+++ b/validator/src/traits.rs
@@ -50,25 +50,25 @@ impl<'a, T> HasLen for &'a Vec<T> {
}
}
-impl<'a, K, V> HasLen for &'a HashMap<K, V> {
+impl<'a, K, V, S> HasLen for &'a HashMap<K, V, S> {... | 3 | 116 | 8 |
3161a854cd0ada200732c726f3bcfcb75df3608f | Arne Beer | 2022-03-15T08:30:32 | add: ValidationErrors::errors_mut (#194) | diff --git a/validator/src/types.rs b/validator/src/types.rs
index 47d19f2..e8d1de2 100644
--- a/validator/src/types.rs
+++ b/validator/src/types.rs
@@ -109,6 +109,12 @@ impl ValidationErrors {
&self.0
}
+ /// Returns a mutable map of field-level validation errors found for the struct that was valida... | 1 | 6 | 0 |
329bcf948b294940ba376413c28f05fe90f90feb | Dylan DPC | 2022-03-09T09:49:43 | Update Cargo.toml (#199) | diff --git a/validator_derive/Cargo.toml b/validator_derive/Cargo.toml
index b93e568..dd69750 100644
--- a/validator_derive/Cargo.toml
+++ b/validator_derive/Cargo.toml
@@ -24,7 +24,7 @@ proc-macro2 = "1"
proc-macro-error = "1"
if_chain = "1"
validator_types = { version = "0.14", path = "../validator_types" }
-regex... | 1 | 1 | 1 |
53e944f576d67c03a0f6fe0a9d441c127b5c2039 | Alexandre Legent | 2022-02-19T13:34:57 | Implementing schema arg validator (#181) | diff --git a/validator_derive/src/lib.rs b/validator_derive/src/lib.rs
index dc9eff8..f5155a5 100644
--- a/validator_derive/src/lib.rs
+++ b/validator_derive/src/lib.rs
@@ -15,6 +15,8 @@ use quoting::{quote_schema_validations, quote_validator, FieldQuoter};
use validation::*;
use validator_types::{CustomArgument, Val... | 4 | 155 | 7 |
47908fe4b0148357245c09eb26c311c37c882960 | Juan J. Jimenez-Anca | 2022-02-19T13:27:14 | allow any string value (#177) | diff --git a/validator_derive/src/asserts.rs b/validator_derive/src/asserts.rs
index 9b11a1a..96b1585 100644
--- a/validator_derive/src/asserts.rs
+++ b/validator_derive/src/asserts.rs
@@ -70,14 +70,7 @@ pub static NUMBER_TYPES: [&str; 38] = [
];
pub fn assert_string_type(name: &str, type_name: &str, field_type: &s... | 1 | 3 | 14 |
7e7ba65d7fef72b02fb9220c91abe8043ce37281 | Christian | 2021-06-29T20:40:37 | Fix parsing of schema validation function (#160)
* fix parsing of schema validation function
* remove commented line
* adding test for fully qualified functions in schema validation | diff --git a/validator_derive/src/quoting.rs b/validator_derive/src/quoting.rs
index 518084c..dbc68b5 100644
--- a/validator_derive/src/quoting.rs
+++ b/validator_derive/src/quoting.rs
@@ -507,7 +507,7 @@ pub fn quote_validator(
}
pub fn quote_schema_validation(v: &SchemaValidation) -> proc_macro2::TokenStream {
- ... | 2 | 50 | 1 |
3a7c93ff2f5eac16f7387397a393db444b0cbc05 | Tilman Roeder | 2021-06-29T20:40:26 | Better display implementation (#158)
* Better display implementation
* Fix failing tests when derive feature is missing | diff --git a/validator/src/display_impl.rs b/validator/src/display_impl.rs
new file mode 100644
index 0000000..c006c18
--- /dev/null
+++ b/validator/src/display_impl.rs
@@ -0,0 +1,73 @@
+use crate::{ValidationError, ValidationErrors, ValidationErrorsKind};
+use std::fmt::{self, Write};
+
+impl fmt::Display for Validati... | 4 | 130 | 13 |
e39ec89f4026e97e3089dabc40e33129a1053a6b | umaYnit | 2021-05-12T05:46:39 | fix find_fields_type error #155 (#156)
* fix find_fields_type error #155
* add test `use_in_declarative_macros` | diff --git a/validator_derive/src/lib.rs b/validator_derive/src/lib.rs
index 5b33fac..772adea 100644
--- a/validator_derive/src/lib.rs
+++ b/validator_derive/src/lib.rs
@@ -206,6 +206,11 @@ fn find_fields_type(fields: &[syn::Field]) -> HashMap<String, String> {
}
name
}
+ ... | 2 | 17 | 0 |
ad820fa6297cf58a70b0940b78bc0855bf5ee065 | Vincent Prouillet | 2021-03-22T20:40:39 | Version change in one more place | diff --git a/validator_derive_tests/Cargo.toml b/validator_derive_tests/Cargo.toml
index 81d6437..4edf94f 100644
--- a/validator_derive_tests/Cargo.toml
+++ b/validator_derive_tests/Cargo.toml
@@ -5,7 +5,7 @@ authors = ["Vincent Prouillet <hello@vincentprouillet.com>"]
edition = "2018"
[dev-dependencies]
-validator... | 1 | 1 | 1 |
1c00a0f32e8deaf15f3ede189c9af3ebd2a01d54 | Evaldas Buinauskas | 2021-03-22T20:33:31 | Allow passing multiple schema-level validations (#146) | diff --git a/validator_derive/src/lib.rs b/validator_derive/src/lib.rs
index 3d191ad..5b33fac 100644
--- a/validator_derive/src/lib.rs
+++ b/validator_derive/src/lib.rs
@@ -15,7 +15,7 @@ mod validation;
use asserts::{assert_has_len, assert_has_range, assert_string_type, assert_type_matches};
use lit::*;
-use quotin... | 3 | 155 | 106 |
955179122a056924ec625f453b02d7486177556e | Evaldas Buinauskas | 2021-03-10T08:36:14 | Simplify validate_ip_v{4,6} methods (#147) | diff --git a/validator/src/validation/ip.rs b/validator/src/validation/ip.rs
index 337ef67..576b8c3 100644
--- a/validator/src/validation/ip.rs
+++ b/validator/src/validation/ip.rs
@@ -8,13 +8,7 @@ pub fn validate_ip_v4<'a, T>(val: T) -> bool
where
T: Into<Cow<'a, str>>,
{
- match IpAddr::from_str(val.into().... | 1 | 2 | 14 |
74c9e1023f2b0f05f8c734e9e769a91797bd2538 | Tuetuopay | 2020-11-25T10:29:54 | asserts: Add support for references to length types (#121)
* asserts: Add support for references to length types
This allows validating a `&'a Vec<...>` rather than only `Vec<...>`.
Similarly, this will ignore the lifetime parameter, thus allowing
`&'a str` in addition to `&str`.
* derive/tests: Add length tes... | diff --git a/validator_derive/src/asserts.rs b/validator_derive/src/asserts.rs
index 66b1524..e6943cb 100644
--- a/validator_derive/src/asserts.rs
+++ b/validator_derive/src/asserts.rs
@@ -80,6 +80,15 @@ pub fn assert_type_matches(
}
pub fn assert_has_len(field_name: String, type_name: &str, field_type: &syn::Type)... | 2 | 33 | 0 |
7d852ef4a62a79be23fb431ee97a66a380f4ec22 | Maksim Kozich | 2020-11-25T10:24:14 | add support for Option<Vec<...>> nested attributes. (#123)
* consider Option<Vec< attributes validation
* add .cargo
* add test
* Delete config
Co-authored-by: Maksim Kozich <m_kozich@wargaming.net>
Co-authored-by: Vincent Prouillet <balthek@gmail.com> | diff --git a/validator_derive/Cargo.toml b/validator_derive/Cargo.toml
index 57204ed..1610a47 100644
--- a/validator_derive/Cargo.toml
+++ b/validator_derive/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "validator_derive"
-version = "0.11.0"
+version = "0.11.1"
authors = ["Vincent Prouillet <hello@vincentprouillet.co... | 3 | 63 | 1 |
6c3f7402f5e0c4323dd3cf96e1ddc60a45d067cf | Vincent Prouillet | 2020-11-24T11:42:49 | Fix features forwarding | diff --git a/validator/Cargo.toml b/validator/Cargo.toml
index 717924c..a6306fa 100644
--- a/validator/Cargo.toml
+++ b/validator/Cargo.toml
@@ -24,7 +24,7 @@ phonenumber = { version = "0.3", optional = true }
unic-ucd-common = { version = "0.9", optional = true }
[features]
-phone = ["phonenumber"]
-card = ["card-... | 1 | 3 | 3 |
99d307ee9e6a30a34b9aa6fa4fa3e1e24d09945a | xFrednet | 2020-11-20T23:53:32 | Added tests for must_match validation with options #7 | diff --git a/validator/src/validation/must_match.rs b/validator/src/validation/must_match.rs
index 738c1c5..2a2e7b8 100644
--- a/validator/src/validation/must_match.rs
+++ b/validator/src/validation/must_match.rs
@@ -32,4 +32,32 @@ mod tests {
fn test_validate_must_match_numbers_false() {
assert_eq!(false... | 1 | 28 | 0 |
5d59c01eaf5f64a6178a9c37d774f6f67496b8c8 | Vincent Prouillet | 2020-09-09T18:41:04 | Re-enable dev dep | diff --git a/validator_derive/Cargo.toml b/validator_derive/Cargo.toml
index e3e794c..57204ed 100644
--- a/validator_derive/Cargo.toml
+++ b/validator_derive/Cargo.toml
@@ -28,7 +28,7 @@ regex = "1"
lazy_static = "1"
[dev-dependencies]
-#validator = { version = "0.11.0", path = "../validator", features = ["phone", ... | 1 | 1 | 1 |
3937b3eda834b24118f250be98f1fb6bb16adc5a | Vincent Prouillet | 2020-09-09T18:39:46 | Temporarily disable dev dep | diff --git a/validator_derive/Cargo.toml b/validator_derive/Cargo.toml
index 57204ed..e3e794c 100644
--- a/validator_derive/Cargo.toml
+++ b/validator_derive/Cargo.toml
@@ -28,7 +28,7 @@ regex = "1"
lazy_static = "1"
[dev-dependencies]
-validator = { version = "0.11.0", path = "../validator", features = ["phone", "... | 1 | 1 | 1 |
34ca7f3d9942d9b8cf528594652b57374609506a | Vincent Prouillet | 2020-09-09T17:24:32 | Update phonenumber | diff --git a/validator/Cargo.toml b/validator/Cargo.toml
index 2ff6847..717924c 100644
--- a/validator/Cargo.toml
+++ b/validator/Cargo.toml
@@ -20,7 +20,7 @@ serde_json = "1"
validator_types = { version = "0.11", path = "../validator_types" }
validator_derive = { version = "0.11", path = "../validator_derive", optio... | 1 | 1 | 1 |
38bc474e33633652f306f3895c19de36832ffb8d | Eric Dattore | 2020-09-09T06:19:41 | Use absolute path for trait impl (#114)
Resolves #112 | diff --git a/validator_derive/src/lib.rs b/validator_derive/src/lib.rs
index fda4e52..3d191ad 100644
--- a/validator_derive/src/lib.rs
+++ b/validator_derive/src/lib.rs
@@ -69,7 +69,7 @@ fn impl_validate(ast: &syn::DeriveInput) -> proc_macro2::TokenStream {
// Helper is provided for handling complex generic types ... | 2 | 16 | 1 |
2cd3d924b84ddd04c4bc13aea639f889e497e6d4 | Albrecht | 2020-09-08T17:40:50 | Invalide Emails (#110)
* find more invalide emails
* more detailed doc
* revert to strict tests, fix unescaped dot issue | diff --git a/validator/src/validation/email.rs b/validator/src/validation/email.rs
index 6b919b1..2d168ab 100644
--- a/validator/src/validation/email.rs
+++ b/validator/src/validation/email.rs
@@ -11,13 +11,15 @@ lazy_static! {
// It will mark esoteric email addresses like quoted string as invalid
static ref ... | 1 | 15 | 6 |
a03d18b4c46cfe4121fc24073109e76d137f77b7 | Vincent Prouillet | 2020-06-09T19:35:16 | Slight tweak on a test | diff --git a/validator_derive/tests/range.rs b/validator_derive/tests/range.rs
index 006d085..510b13f 100644
--- a/validator_derive/tests/range.rs
+++ b/validator_derive/tests/range.rs
@@ -89,4 +89,5 @@ fn can_pass_reference_as_validate() {
let val = TestStruct { num_field: 10 };
validate(&val).unwrap_err()... | 1 | 1 | 0 |
f51e0d671880b32a574060c642e405c590dd0974 | Lucas Pickering | 2020-05-20T11:48:37 | Add a blanket Validate implementation for references | diff --git a/validator/src/traits.rs b/validator/src/traits.rs
index 61bb002..93b23fa 100644
--- a/validator/src/traits.rs
+++ b/validator/src/traits.rs
@@ -93,3 +93,9 @@ impl<'a, S, H: ::std::hash::BuildHasher> Contains for &'a HashMap<String, S, H>
pub trait Validate {
fn validate(&self) -> Result<(), Validatio... | 2 | 26 | 1 |
c2ad0c0287bed844df35896f6bdfb85658748966 | Ole Martin Ruud | 2020-04-10T03:30:51 | Specify static lifetime for field_errors | diff --git a/validator/src/types.rs b/validator/src/types.rs
index 5d90d04..932a037 100644
--- a/validator/src/types.rs
+++ b/validator/src/types.rs
@@ -121,7 +121,7 @@ impl ValidationErrors {
}
/// Returns a map of only field-level validation errors found for the struct that was validated.
- pub fn fiel... | 1 | 1 | 1 |
d868a82f1a5794b9b50839f78670c8d9092b55cd | Andreas Sommer | 2020-02-15T14:16:04 | Add `must_use` attribute to functions returning `bool` | diff --git a/validator/src/traits.rs b/validator/src/traits.rs
index cf86919..61bb002 100644
--- a/validator/src/traits.rs
+++ b/validator/src/traits.rs
@@ -49,6 +49,7 @@ impl<'a, T> HasLen for &'a Vec<T> {
/// Trait to implement if one wants to make the `contains` validator
/// work for more types
pub trait Contain... | 12 | 17 | 0 |
f57048e58c59317ec18a37a86e7fd848670fff85 | Vincent Prouillet | 2019-10-17T20:03:45 | Fix bug with card import | diff --git a/validator/src/validation/cards.rs b/validator/src/validation/cards.rs
index 8c97694..19d91ab 100644
--- a/validator/src/validation/cards.rs
+++ b/validator/src/validation/cards.rs
@@ -1,6 +1,6 @@
use std::borrow::Cow;
-use crate::card_validate::Validate as CardValidate;
+use card_validate::Validate as C... | 1 | 1 | 1 |
0877c01f9a1bf5bcda3e3b235730f4d09982d8d2 | Vincent Prouillet | 2019-07-13T14:35:37 | Update if_chain | diff --git a/validator_derive/Cargo.toml b/validator_derive/Cargo.toml
index f985e1d..e8e50aa 100644
--- a/validator_derive/Cargo.toml
+++ b/validator_derive/Cargo.toml
@@ -19,7 +19,7 @@ card = ["validator/card"]
syn = { version = "0.15", features = ["extra-traits"] }
quote = "0.6"
proc-macro2 = "0.4"
-if_chain = "0... | 1 | 1 | 1 |
798988018920144535f2bd5aa93a8d3f4423b42c | Vincent Prouillet | 2019-05-01T18:49:43 | Update deps of validator_derive | diff --git a/validator_derive/Cargo.toml b/validator_derive/Cargo.toml
index 52aad39..f985e1d 100644
--- a/validator_derive/Cargo.toml
+++ b/validator_derive/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "validator_derive"
-version = "0.8.0"
+version = "0.9.0"
authors = ["Vincent Prouillet <prouillet.vincent@gmail.com... | 1 | 2 | 2 |
bd27ea34f904a8746c682c0cef90c4f1083b5798 | Vincent Prouillet | 2018-09-19T07:59:06 | Update deps of validator | diff --git a/validator_derive/Cargo.toml b/validator_derive/Cargo.toml
index c7dc0db..52aad39 100644
--- a/validator_derive/Cargo.toml
+++ b/validator_derive/Cargo.toml
@@ -20,7 +20,7 @@ syn = { version = "0.15", features = ["extra-traits"] }
quote = "0.6"
proc-macro2 = "0.4"
if_chain = "0"
-validator = { version = ... | 1 | 1 | 1 |
a1d0f78318762f51d80cd9f847375bd6fc445e79 | Vincent Prouillet | 2018-09-13T16:49:53 | Update syn | diff --git a/validator_derive/Cargo.toml b/validator_derive/Cargo.toml
index bcacc9b..d7bf3bb 100644
--- a/validator_derive/Cargo.toml
+++ b/validator_derive/Cargo.toml
@@ -16,7 +16,7 @@ phone = ["validator/phone"]
card = ["validator/card"]
[dependencies]
-syn = { version = "0.14", features = ["extra-traits"] }
+sy... | 1 | 1 | 1 |
f4b11eaecb8fcc4798eb3a932a68c47ed802d96d | Simon Sparks | 2018-07-27T09:02:04 | Added support for validating Cow<'a, str> fields. (#56)
* Added support for validating Cow<'a, str> fields.
Keats/validator#55
* Corrected error message comparison in compiler-fail/length test.
Keats/validator#55 | diff --git a/validator/src/traits.rs b/validator/src/traits.rs
index 896fcc7..c34819c 100644
--- a/validator/src/traits.rs
+++ b/validator/src/traits.rs
@@ -1,3 +1,4 @@
+use std::borrow::Cow;
use std::collections::HashMap;
use types::ValidationErrors;
@@ -29,6 +30,12 @@ impl<'a> HasLen for &'a str {
}
}
+im... | 14 | 205 | 28 |
e5ec5504890b47a7df3b032361ff37f9ca369e22 | Bastien Orivel | 2018-06-20T06:20:42 | Update syn, quote and bump version | diff --git a/validator_derive/Cargo.toml b/validator_derive/Cargo.toml
index 717a838..3e80bbc 100644
--- a/validator_derive/Cargo.toml
+++ b/validator_derive/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "validator_derive"
-version = "0.7.0"
+version = "0.7.1"
authors = ["Vincent Prouillet <vincent@wearewizards.io>"]
... | 5 | 39 | 37 |
91592718aa3d6ae102ae31ee08bd3ae7bd57adec | Erin | 2018-05-16T01:50:18 | feature gate card validator | diff --git a/validator/Cargo.toml b/validator/Cargo.toml
index 079fefb..1d57814 100644
--- a/validator/Cargo.toml
+++ b/validator/Cargo.toml
@@ -16,8 +16,9 @@ idna = "0.1"
serde = "1"
serde_derive = "1"
serde_json = "1"
-card-validate = "2.1"
+card-validate = { version = "2.1", optional = true }
phonenumber = { ver... | 7 | 9 | 1 |
56a5a34c8653f6475d00ca99c22f50d255a0669d | Erin | 2018-04-13T18:48:12 | fix path parsing for regex validators
see also: 8ca1fe94d779dcccf4b3f4c23a08f3ede7e10956 | diff --git a/validator_derive/src/quoting.rs b/validator_derive/src/quoting.rs
index b6053f4..a3e25cb 100644
--- a/validator_derive/src/quoting.rs
+++ b/validator_derive/src/quoting.rs
@@ -307,7 +307,7 @@ pub fn quote_regex_validation(field_quoter: &FieldQuoter, validation: &FieldVali
let validator_param = field_q... | 2 | 28 | 1 |
8ca1fe94d779dcccf4b3f4c23a08f3ede7e10956 | Bastien Orivel | 2018-03-18T22:38:38 | Fix path parsing for custom validators
`::foo::bar` isn't a valid ident in syn 0.12. This lead to some code
failing to compile if it was using paths as custom validators.
This fixes it and adds a test. | diff --git a/validator_derive/Cargo.toml b/validator_derive/Cargo.toml
index 00c7de7..9c0c67f 100644
--- a/validator_derive/Cargo.toml
+++ b/validator_derive/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "validator_derive"
-version = "0.6.2"
+version = "0.6.3"
authors = ["Vincent Prouillet <vincent@wearewizards.io>"]
... | 3 | 8 | 2 |
2911d169468a232e90be81b6a00e21ce18be74b0 | Sharad Chand | 2018-03-18T03:40:40 | Added test to validate None values | diff --git a/validator_derive/tests/complex.rs b/validator_derive/tests/complex.rs
index e7495b4..bbbc2e6 100644
--- a/validator_derive/tests/complex.rs
+++ b/validator_derive/tests/complex.rs
@@ -185,3 +185,35 @@ fn test_works_with_question_mark_operator() {
assert!(some_fn().is_err());
}
+
+#[test]
+fn test_w... | 1 | 32 | 0 |
bcc9b005a4784d1c67a1622c93589377dae4d11c | Sharad Chand | 2018-03-18T03:36:10 | Added Option<Option<Vec<T>> field to test | diff --git a/validator_derive/tests/complex.rs b/validator_derive/tests/complex.rs
index 0a4c5f0..e7495b4 100644
--- a/validator_derive/tests/complex.rs
+++ b/validator_derive/tests/complex.rs
@@ -131,6 +131,8 @@ fn test_can_validate_option_fields_without_lifetime() {
address: Option<Option<String>>,
... | 1 | 3 | 0 |
f01d70d1f9a21b84776b6f92df0bd6e6c356cd61 | Sharad Chand | 2018-03-18T03:32:35 | Added complex tests | diff --git a/validator_derive/tests/complex.rs b/validator_derive/tests/complex.rs
index 0bd74fa..0a4c5f0 100644
--- a/validator_derive/tests/complex.rs
+++ b/validator_derive/tests/complex.rs
@@ -81,6 +81,10 @@ fn test_can_validate_option_fields_with_lifetime() {
struct PutStruct<'a> {
#[validate(length(... | 1 | 12 | 0 |
c4c325ef653126a5d0150a3aff03f9cef03a6d6e | Sharad Chand | 2018-03-18T03:31:59 | Optional validator params and wraping for Option<Option<T>> | diff --git a/validator_derive/src/quoting.rs b/validator_derive/src/quoting.rs
index bf2a531..2ffade8 100644
--- a/validator_derive/src/quoting.rs
+++ b/validator_derive/src/quoting.rs
@@ -40,7 +40,8 @@ impl FieldQuoter {
pub fn get_optional_validator_param(&self) -> quote::Tokens {
let ident = &self.id... | 1 | 9 | 2 |
89416fd17eadd6e04b1b1a6829302e56a4f9a806 | Sharad Chand | 2018-03-18T03:31:24 | Added assertions for Option<Option<T>> | diff --git a/validator_derive/src/asserts.rs b/validator_derive/src/asserts.rs
index 65db5cf..53d76ae 100644
--- a/validator_derive/src/asserts.rs
+++ b/validator_derive/src/asserts.rs
@@ -1,5 +1,5 @@
-pub static NUMBER_TYPES: [&'static str; 24] = [
+pub static NUMBER_TYPES: [&'static str; 36] = [
"usize", "u8",... | 1 | 11 | 2 |
066b1a701858a9d85e5ca52441ed1c6e87fb6b5f | Vincent Prouillet | 2018-03-17T19:56:10 | Update phone_number dep | diff --git a/validator/Cargo.toml b/validator/Cargo.toml
index be60098..079fefb 100644
--- a/validator/Cargo.toml
+++ b/validator/Cargo.toml
@@ -17,7 +17,7 @@ serde = "1"
serde_derive = "1"
serde_json = "1"
card-validate = "2.1"
-phonenumber = { version = "0.1.0+8.7.0", optional = true }
+phonenumber = { version = "... | 1 | 1 | 1 |
f8a91c125f801e678ec88396a4409883213e17fd | Bastien Orivel | 2018-03-16T19:16:30 | Bump version | diff --git a/validator_derive/Cargo.toml b/validator_derive/Cargo.toml
index 3827490..00c7de7 100644
--- a/validator_derive/Cargo.toml
+++ b/validator_derive/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "validator_derive"
-version = "0.6.1"
+version = "0.6.2"
authors = ["Vincent Prouillet <vincent@wearewizards.io>"]
... | 1 | 1 | 1 |
b2cda48e139d5b599b813601ad806420f1f3757a | Bastien Orivel | 2018-03-16T19:15:53 | Bump syn to 0.12 and quote to 0.4 | diff --git a/validator_derive/Cargo.toml b/validator_derive/Cargo.toml
index cd00a3a..3827490 100644
--- a/validator_derive/Cargo.toml
+++ b/validator_derive/Cargo.toml
@@ -15,8 +15,8 @@ proc-macro = true
phone = ["validator/phone"]
[dependencies]
-syn = "0.11"
-quote = "0.3"
+syn = { version = "0.12", features = [... | 5 | 135 | 148 |
cd6cf76e5a890dec01f3616c7df4f4b86a4ea1a5 | Bastien Orivel | 2018-01-28T21:46:03 | Don't emit a warning when a struct with no validator derives Validate | diff --git a/validator_derive/src/lib.rs b/validator_derive/src/lib.rs
index 1678883..6700c2a 100644
--- a/validator_derive/src/lib.rs
+++ b/validator_derive/src/lib.rs
@@ -74,6 +74,7 @@ fn impl_validate(ast: &syn::MacroInput) -> quote::Tokens {
let (impl_generics, ty_generics, where_clause) = ast.generics.split_f... | 1 | 1 | 0 |
ab55eacbf9babb664657757c92d0b44b084385d8 | Vincent Prouillet | 2018-01-25T10:01:37 | Update some dependencies | diff --git a/validator_derive/Cargo.toml b/validator_derive/Cargo.toml
index 49560a0..cd00a3a 100644
--- a/validator_derive/Cargo.toml
+++ b/validator_derive/Cargo.toml
@@ -18,16 +18,14 @@ phone = ["validator/phone"]
syn = "0.11"
quote = "0.3"
if_chain = "0"
+validator = { version = "0.6", path = "../validator"}
... | 1 | 3 | 5 |
50307fb74caaf8e279b9ea3f50b6683a67260333 | gtors | 2017-12-17T12:30:36 | Move extraction of message and code in single function | diff --git a/validator_derive/src/validation.rs b/validator_derive/src/validation.rs
index 7598d79..bbec9d6 100644
--- a/validator_derive/src/validation.rs
+++ b/validator_derive/src/validation.rs
@@ -36,8 +36,7 @@ pub fn extract_length_validation(field: String, meta_items: &Vec<syn::NestedMeta
let mut max = None;... | 1 | 43 | 69 |
8227542bb01dffa79f7e08694291480b3df3d728 | Bastien Orivel | 2017-12-04T20:20:42 | Update lazy_static to 1.0 and bump version | diff --git a/validator/Cargo.toml b/validator/Cargo.toml
index 06ef32c..be60098 100644
--- a/validator/Cargo.toml
+++ b/validator/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "validator"
-version = "0.6.2"
+version = "0.6.3"
authors = ["Vincent Prouillet <vincent@wearewizards.io>"]
license = "MIT"
description = "Co... | 1 | 2 | 2 |
9b175bc3ca7a2a65add0ec4a42a79b5c9f47314b | Vincent Prouillet | 2017-11-08T16:16:24 | Add missing credit_card derive impl | diff --git a/validator/Cargo.toml b/validator/Cargo.toml
index f081b7f..06ef32c 100644
--- a/validator/Cargo.toml
+++ b/validator/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "validator"
-version = "0.6.1"
+version = "0.6.2"
authors = ["Vincent Prouillet <vincent@wearewizards.io>"]
license = "MIT"
description = "Co... | 8 | 111 | 7 |
c644dc0aba4e927d299b0f93fd3b87bbaf8f366c | Dmitry Vdovin | 2017-09-28T14:04:24 | [#29] Add test for `?` operator | diff --git a/validator_derive/tests/complex.rs b/validator_derive/tests/complex.rs
index db5f1bf..0bd74fa 100644
--- a/validator_derive/tests/complex.rs
+++ b/validator_derive/tests/complex.rs
@@ -9,7 +9,7 @@ extern crate regex;
extern crate lazy_static;
use regex::Regex;
-use validator::{Validate, ValidationError}... | 1 | 18 | 1 |
e9e22536bca048216c3c57196a4c2c1352b30e68 | Dmitry Vdovin | 2017-09-21T08:40:41 | [#29] Implement Error and Display for ValidationErrors | diff --git a/validator/src/types.rs b/validator/src/types.rs
index bb176c3..5c62e6d 100644
--- a/validator/src/types.rs
+++ b/validator/src/types.rs
@@ -59,3 +59,14 @@ impl ValidationErrors {
self.0.is_empty()
}
}
+
+impl std::error::Error for ValidationErrors {
+ fn description(&self) -> &str { "Vali... | 1 | 11 | 0 |
364056c01c3d5640d677532d1b6e7e40068090a4 | Vincent Prouillet | 2017-08-12T04:10:15 | Update validator_derive to use crates.io for validator | diff --git a/validator_derive/Cargo.toml b/validator_derive/Cargo.toml
index e234b86..99e88c2 100644
--- a/validator_derive/Cargo.toml
+++ b/validator_derive/Cargo.toml
@@ -25,5 +25,5 @@ regex = "0.2"
lazy_static = "0.2"
[dependencies.validator]
-path = "../validator"
-# version = "0.4.0"
+# path = "../validator"
+... | 1 | 2 | 2 |
1754cbf8f1c6ab8b82c6caf7a0fcc86834403bf8 | Vincent Prouillet | 2017-05-22T14:36:15 | Update serde to 1.0 | diff --git a/validator_derive/Cargo.toml b/validator_derive/Cargo.toml
index bc8f991..c62a1f8 100644
--- a/validator_derive/Cargo.toml
+++ b/validator_derive/Cargo.toml
@@ -16,9 +16,9 @@ syn = "0.11"
quote = "0.3"
[dev-dependencies]
-serde = "0.9"
-serde_derive = "0.9"
-serde_json = "0.9"
+serde = "1.0"
+serde_deri... | 1 | 3 | 3 |
314867ecf7f1ac29e9035b5f5f6acab1e82b62b0 | Vincent Prouillet | 2017-05-22T14:36:08 | Add test for Option in range validator | diff --git a/validator_derive/tests/run-pass/range.rs b/validator_derive/tests/run-pass/range.rs
index 79e3229..e35f3df 100644
--- a/validator_derive/tests/run-pass/range.rs
+++ b/validator_derive/tests/run-pass/range.rs
@@ -22,6 +22,8 @@ struct Test {
s7: i8,
#[validate(range(min = 18.0, max = 22))]
s8:... | 1 | 2 | 0 |
ab153dca8298214ce09a0fe4f9ce156dc9a92abb | René Perschon | 2017-05-22T14:02:39 | Added missing signs; fixes issue #23 | diff --git a/validator_derive/src/lib.rs b/validator_derive/src/lib.rs
index 698eb3f..6bc8313 100644
--- a/validator_derive/src/lib.rs
+++ b/validator_derive/src/lib.rs
@@ -18,9 +18,9 @@ static RANGE_TYPES: [&'static str; 24] = [
"isize", "i8", "i16", "i32", "i64",
"f32", "f64",
- "Option<usize>", "Optio... | 1 | 3 | 3 |
7227d46a6be8a977fdf5b4171afef29dc0654883 | theduke | 2017-02-16T18:43:12 | Implement Error for Errors.
For Dispaly, it's not the prettiest output imaginable,
since it just contains error codes.
But it's still better than nothing. | diff --git a/validator/src/types.rs b/validator/src/types.rs
index 5b96cfe..0a7c2fa 100644
--- a/validator/src/types.rs
+++ b/validator/src/types.rs
@@ -1,6 +1,6 @@
+use std::{self, fmt};
use std::collections::HashMap;
-
#[derive(Debug)]
pub struct Errors(HashMap<String, Vec<String>>);
@@ -22,6 +22,33 @@ impl Er... | 1 | 28 | 1 |
aa2218190f7d0c0346944c10fb54a80641fdd41b | Vincent Prouillet | 2017-02-14T03:23:19 | Fix compile fail tests | diff --git a/validator_derive/Cargo.toml b/validator_derive/Cargo.toml
index ff64a40..a47ac41 100644
--- a/validator_derive/Cargo.toml
+++ b/validator_derive/Cargo.toml
@@ -25,4 +25,4 @@ lazy_static = "0.2"
[dependencies.validator]
# path = "../validator"
-version = "0.3.0"
+version = "0.4.0"
diff --git a/validator... | 14 | 14 | 14 |
196db165b44af464a2e5b034b9dad5942bd99d4a | theduke | 2017-02-10T04:12:18 | Ignore unused ident in pattern | diff --git a/validator_derive/src/lib.rs b/validator_derive/src/lib.rs
index 735ac44..698eb3f 100644
--- a/validator_derive/src/lib.rs
+++ b/validator_derive/src/lib.rs
@@ -317,7 +317,7 @@ fn find_struct_validation(struct_attrs: &Vec<syn::Attribute>) -> Option<SchemaVa
continue;
}
match a... | 1 | 1 | 1 |
77503cbf5e16f1f25278940b44c60060825a3b19 | theduke | 2017-02-10T03:50:21 | validator_derive: Properly skip foreign attributes.
The old code only skips attributes if they are MetaItem::List.
With a simple change, all attributes are skipped if they are not
named "validate". | diff --git a/validator_derive/src/lib.rs b/validator_derive/src/lib.rs
index 0ad26a9..735ac44 100644
--- a/validator_derive/src/lib.rs
+++ b/validator_derive/src/lib.rs
@@ -313,12 +313,11 @@ fn find_struct_validation(struct_attrs: &Vec<syn::Attribute>) -> Option<SchemaVa
};
for attr in struct_attrs {
+ ... | 1 | 3 | 4 |
74a83684a0f3dcc8824fe124fa047641ddf2f7bc | Vincent Prouillet | 2017-01-28T10:04:48 | Update deps | diff --git a/validator/Cargo.toml b/validator/Cargo.toml
index 5698e7a..35d8037 100644
--- a/validator/Cargo.toml
+++ b/validator/Cargo.toml
@@ -9,7 +9,7 @@ repository = "https://github.com/Keats/validator"
keywords = ["validation", "api", "validator"]
[dependencies]
-url = "1.3"
+url = "1"
regex = "0.2"
lazy_sta... | 15 | 11 | 25 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.