diff options
| author | Caroline Glassberg-Powell | 2019-04-28 18:45:40 +0100 | 
|---|---|---|
| committer | Caroline Glassberg-Powell | 2019-04-28 19:01:08 +0100 | 
| commit | 6e8effdaa2b47f4056a00d301a9e7a5a1a2fd8dc (patch) | |
| tree | 781b99ec57192adb777681243b8161fd37a10bae /README.md | |
| parent | 4b9fe3939b106c151bff11e490a41212559f9a4a (diff) | |
| download | validator-6e8effdaa2b47f4056a00d301a9e7a5a1a2fd8dc.tar.bz2 | |
Issue #69: Change `range` to require only one arg
Currently range is hard-coded to take both max and min. This is
unhelpful in cases where we may only want to check one of the bounds.
Update so that it behaves more like the `length` validator and can take
either max or min, as well as both. Also ensure that at least one of
them is supplied.
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 4 | 
1 files changed, 3 insertions, 1 deletions
| @@ -179,14 +179,16 @@ Examples:  ```  ### range -Tests whether a number is in the given range. `range` takes 2 number arguments: `min` and `max`. +Tests whether a number is in the given range. `range` takes between 1 and 2 number arguments: `min` and `max`.  Examples:  ```rust  #[validate(range(min = "1", max = "10"))] +#[validate(range(min = "1"))]  #[validate(range(min = "1", max = "10.8"))]  #[validate(range(min = "1.1", max = "10.8"))] +#[validate(range(max = "10.8"))]  ```  ### must_match | 
