11use std:: collections:: { HashMap , HashSet , VecDeque } ;
22
33use crate :: rule:: composer:: Not ;
4- use crate :: rule:: { ForAllRule , Rule } ;
4+ use crate :: rule:: { ForAllRule , Iterable , Rule } ;
55use crate :: Refined ;
66
77/// A type that holds a value satisfying the `ExistsRule`
8- pub type Exists < RULE , ITERABLE > = Refined < ExistsRule < RULE , ITERABLE , < RULE as Rule > :: Item > > ;
8+ pub type Exists < RULE , ITERABLE > = Refined < ExistsRule < RULE , ITERABLE > > ;
99
1010/// A type that holds a Vec value satisfying the `ExistsRule`
1111pub type ExistsVec < RULE > = Refined < ExistsVecRule < RULE > > ;
@@ -23,25 +23,23 @@ pub type ExistsHashMap<K, RULE> = Refined<ExistsHashMapRule<K, RULE>>;
2323pub type ExistsString < RULE > = Refined < ExistsStringRule < RULE > > ;
2424
2525/// Rule where at least one data in the collection satisfies the condition
26- pub type ExistsRule < RULE , ITERABLE , ITEM > = Not < ForAllRule < Not < RULE > , ITERABLE , ITEM > > ;
26+ pub type ExistsRule < RULE , ITERABLE > =
27+ Not < ForAllRule < Not < RULE > , ITERABLE , <ITERABLE as Iterable >:: Item > > ;
2728
2829/// Rule where at least one data in the `Vec` satisfies the condition
29- pub type ExistsVecRule < RULE > = ExistsRule < RULE , Vec < <RULE as Rule >:: Item > , < RULE as Rule > :: Item > ;
30+ pub type ExistsVecRule < RULE > = ExistsRule < RULE , Vec < <RULE as Rule >:: Item > > ;
3031
3132/// Rule where at least one data in the `VecDeque` satisfies the condition
32- pub type ExistsVecDequeRule < RULE > =
33- ExistsRule < RULE , VecDeque < <RULE as Rule >:: Item > , <RULE as Rule >:: Item > ;
33+ pub type ExistsVecDequeRule < RULE > = ExistsRule < RULE , VecDeque < <RULE as Rule >:: Item > > ;
3434
3535/// Rule where at least one data in the `HashSet` satisfies the condition
36- pub type ExistsHashSetRule < RULE > =
37- ExistsRule < RULE , HashSet < <RULE as Rule >:: Item > , <RULE as Rule >:: Item > ;
36+ pub type ExistsHashSetRule < RULE > = ExistsRule < RULE , HashSet < <RULE as Rule >:: Item > > ;
3837
3938/// Rule where at least one data in the `HashMap` satisfies the condition
40- pub type ExistsHashMapRule < K , RULE > =
41- ExistsRule < RULE , HashMap < K , <RULE as Rule >:: Item > , <RULE as Rule >:: Item > ;
39+ pub type ExistsHashMapRule < K , RULE > = ExistsRule < RULE , HashMap < K , <RULE as Rule >:: Item > > ;
4240
4341/// Rule where at least one data in the `String` satisfies the condition
44- pub type ExistsStringRule < RULE > = ExistsRule < RULE , String , char > ;
42+ pub type ExistsStringRule < RULE > = ExistsRule < RULE , String > ;
4543
4644#[ cfg( test) ]
4745mod tests {
0 commit comments