Commit 7a4b035 1 parent 32e49fb commit 7a4b035 Copy full SHA for 7a4b035
File tree 7 files changed +4
-14
lines changed
7 files changed +4
-14
lines changed Original file line number Diff line number Diff line change 24
24
run : |
25
25
cargo build --no-default-features
26
26
cargo test --no-default-features
27
- cargo build --features unic --features derive --features card
28
- cargo test --features unic --features derive --features card
27
+ cargo build --features derive --features card
28
+ cargo test --features derive --features card
29
29
test_validator-nightly :
30
30
name : Continuous integration
31
31
runs-on : ubuntu-latest
Original file line number Diff line number Diff line change @@ -335,7 +335,6 @@ Examples:
335
335
336
336
### non_control_character
337
337
Tests whether the String has any utf-8 control characters, fails validation if it does.
338
- To use this validator, you must enable the ` unic ` feature for the ` validator ` crate.
339
338
This validator doesn't take any arguments: ` #[validate(non_control_character)] ` ;
340
339
341
340
### required
Original file line number Diff line number Diff line change @@ -21,11 +21,9 @@ serde_derive = "1"
21
21
serde_json = " 1"
22
22
validator_derive = { version = " 0.20" , path = " ../validator_derive" , optional = true }
23
23
card-validate = { version = " 2.3" , optional = true }
24
- unic-ucd-common = { version = " 0.9" , optional = true }
25
24
indexmap = { version = " 2.0.0" , features = [" serde" ], optional = true }
26
25
27
26
[features ]
28
27
card = [" card-validate" ]
29
- unic = [" unic-ucd-common" ]
30
28
derive = [" validator_derive" ]
31
29
derive_nightly_features = [" derive" ," validator_derive/nightly_features" ]
Original file line number Diff line number Diff line change 47
47
//! | `custom` | |
48
48
//! | `regex` | |
49
49
//! | `credit_card` | (Requires the feature `card` to be enabled) |
50
- //! | `non_control_character` | (Required the feature `unic` to be enabled) |
50
+ //! | `non_control_character` | |
51
51
//! | `required` | |
52
52
//!
53
53
//! [Checkout the project README of an in-depth usage description with examples.](https://github.com/Keats/validator/blob/master/README.md)
@@ -73,7 +73,6 @@ pub use validation::email::ValidateEmail;
73
73
pub use validation:: ip:: ValidateIp ;
74
74
pub use validation:: length:: ValidateLength ;
75
75
pub use validation:: must_match:: validate_must_match;
76
- #[ cfg( feature = "unic" ) ]
77
76
pub use validation:: non_control_character:: ValidateNonControlCharacter ;
78
77
pub use validation:: range:: ValidateRange ;
79
78
pub use validation:: regex:: { AsRegex , ValidateRegex } ;
Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ pub mod ip;
7
7
pub mod length;
8
8
pub mod must_match;
9
9
// pub mod nested;
10
- #[ cfg( feature = "unic" ) ]
11
10
pub mod non_control_character;
12
11
pub mod range;
13
12
pub mod regex;
Original file line number Diff line number Diff line change 1
- #[ cfg( feature = "unic" ) ]
2
- use unic_ucd_common:: control;
3
-
4
1
pub trait ValidateNonControlCharacter {
5
2
fn validate_non_control_character ( & self ) -> bool {
6
- self . as_non_control_character_iterator ( ) . all ( |code| !control :: is_control ( code ) )
3
+ self . as_non_control_character_iterator ( ) . all ( |code| !code . is_control ( ) )
7
4
}
8
5
9
6
fn as_non_control_character_iterator ( & self ) -> Box < dyn Iterator < Item = char > + ' _ > ;
@@ -16,7 +13,6 @@ impl<T: AsRef<str>> ValidateNonControlCharacter for T {
16
13
}
17
14
18
15
#[ cfg( test) ]
19
- #[ cfg( feature = "unic" ) ]
20
16
mod tests {
21
17
use super :: ValidateNonControlCharacter ;
22
18
use std:: borrow:: Cow ;
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ nightly = []
13
13
[dev-dependencies ]
14
14
validator = { version = " 0.20" , path = " ../validator" , features = [
15
15
" card" ,
16
- " unic" ,
17
16
" derive" ,
18
17
" indexmap" ,
19
18
] }
You can’t perform that action at this time.
0 commit comments