aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorVincent Prouillet2016-12-29 13:13:42 +0900
committerVincent Prouillet2016-12-29 13:16:41 +0900
commita0f2b4c0d4820bfdcc13c7abdfdc7802d9f6d493 (patch)
tree75b5bc7b008ac374ac0a437de580d5eda1c67a52 /README.md
parentce9ee1ce4ac73ba7989c88c67b16243cbcec2b98 (diff)
downloadvalidator-a0f2b4c0d4820bfdcc13c7abdfdc7802d9f6d493.tar.bz2
Added must_match
Diffstat (limited to 'README.md')
-rw-r--r--README.md10
1 files changed, 10 insertions, 0 deletions
diff --git a/README.md b/README.md
index 0c26d77..62db83c 100644
--- a/README.md
+++ b/README.md
@@ -103,6 +103,16 @@ Examples:
#[validate(range(min = 1.1, max = 10.8))]
```
+### must_match
+Tests whether the 2 fields are equal. `must_match` takes 1 string argument. It will error if the field
+mentioned is missing or has a different type than the field the attribute is on.
+
+Examples:
+
+```rust
+#[validate(must_match = "password2"))]
+```
+
### custom
Calls one of your function to do a custom validation.
The field will be given as parameter and it should return a `Option<String>` representing the error code,