Skip to content

Commit b2fd8ee

Browse files
committed
...
1 parent fc00172 commit b2fd8ee

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

README.md

+4-8
Original file line numberDiff line numberDiff line change
@@ -148,18 +148,14 @@ Therefore, it can be treated much like a composite function
148148
fn main() {
149149
struct StartWithHelloRule;
150150
struct StartWithByeRule;
151-
152151
struct EndWithJohnRule;
153152

154-
type StartWithHelloOrByeRule = Or<StartWithHelloRule, StartWithByeRule>;
155-
type GreetingRule = And<StartWithHelloOrByeRule, EndWithJohnRule>;
156-
157-
type Greeting = Refined<GreetingRule>;
153+
type GreetingRule = And<Or<StartWithHelloRule, StartWithByeRule>, EndWithJohnRule>;
158154

159155
assert!(GreetingRule::validate("Hello! Nice to meet you John".to_string()).is_ok());
160-
assert!(Greeting::validate("Bye! Have a good day John".to_string()).is_ok());
161-
assert!(Greeting::validate("How are you? Have a good day John".to_string()).is_err());
162-
assert!(Greeting::validate("Bye! Have a good day Tom".to_string()).is_err());
156+
assert!(GreetingRule::validate("Bye! Have a good day John".to_string()).is_ok());
157+
assert!(GreetingRule::validate("How are you? Have a good day John".to_string()).is_err());
158+
assert!(GreetingRule::validate("Bye! Have a good day Tom".to_string()).is_err());
163159
}
164160
```
165161

0 commit comments

Comments
 (0)