-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #81 from greyblake/string-char-len
Rename max_len -> char_len_max; min_len -> char_len_min
- Loading branch information
Showing
16 changed files
with
59 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
use nutype::nutype; | ||
|
||
#[nutype(validate(maxLen = 255))] | ||
#[nutype(validate(charLenMax = 255))] | ||
pub struct Name(String); | ||
|
||
fn main () {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
error: Unknown validator `maxLen`. Did you mean `max_len`? | ||
error: Unknown validator `charLenMax`. Did you mean `char_len_max`? | ||
--> tests/ui/common/attribute_with_wrong_case.rs:3:19 | ||
| | ||
3 | #[nutype(validate(maxLen = 255))] | ||
| ^^^^^^ | ||
3 | #[nutype(validate(charLenMax = 255))] | ||
| ^^^^^^^^^^ |
2 changes: 1 addition & 1 deletion
2
.../ui/string/validate/min_len_vs_max_len.rs → .../validate/char_len_min_vs_char_len_max.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
use nutype::nutype; | ||
|
||
#[nutype(validate(min_len = 127, max_len = 63))] | ||
#[nutype(validate(char_len_min = 127, char_len_max = 63))] | ||
pub struct Email(String); | ||
|
||
fn main () {} |
6 changes: 6 additions & 0 deletions
6
test_suite/tests/ui/string/validate/char_len_min_vs_char_len_max.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
error: `char_len_min` cannot be greater than `char_len_max`. | ||
Don't you find this obvious? | ||
--> tests/ui/string/validate/char_len_min_vs_char_len_max.rs:3:54 | ||
| | ||
3 | #[nutype(validate(char_len_min = 127, char_len_max = 63))] | ||
| ^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
use nutype::nutype; | ||
|
||
#[nutype(validate(min_len = 5, max_len = 255, min_len = 6))] | ||
#[nutype(validate(char_len_min = 5, char_len_max = 255, char_len_min = 6))] | ||
pub struct Email(String); | ||
|
||
fn main () {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
error: Duplicated validators `min_len`. | ||
error: Duplicated validators `char_len_min`. | ||
Don't worry, you still remain ingenious! | ||
--> tests/ui/string/validate/duplicated.rs:3:57 | ||
--> tests/ui/string/validate/duplicated.rs:3:72 | ||
| | ||
3 | #[nutype(validate(min_len = 5, max_len = 255, min_len = 6))] | ||
| ^ | ||
3 | #[nutype(validate(char_len_min = 5, char_len_max = 255, char_len_min = 6))] | ||
| ^ |
6 changes: 0 additions & 6 deletions
6
test_suite/tests/ui/string/validate/min_len_vs_max_len.stderr
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters