We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6ee2920 commit be2b9d3Copy full SHA for be2b9d3
tests/length.rs
@@ -7,12 +7,13 @@ length_less_than!(10);
7
8
#[test]
9
fn test_length() -> Result<(), refined_type::result::Error> {
10
- type Password = Refined<
11
- And<
12
- Or<LengthEqualRule5<String>, LengthGreaterThanRule5<String>>,
13
- Or<LengthLessThanRule10<String>, LengthEqualRule10<String>>,
14
- >,
+ type Password = Refined<From5To10Rule<String>>;
+
+ type From5To10Rule<T> = And<
+ Or<LengthEqualRule5<T>, LengthGreaterThanRule5<T>>,
+ Or<LengthLessThanRule10<T>, LengthEqualRule10<T>>,
15
>;
16
17
let raw_password = "password";
18
let password = Password::new(raw_password.to_string())?;
19
assert_eq!(password.into_value(), "password");
0 commit comments