@@ -11,7 +11,7 @@ fn inputs() -> impl Strategy<Value = Vec<(u32, u32)>> {
1111
1212/// The original way to use datafrog -- computes reachable nodes from a set of edges
1313fn reachable_with_var_join ( edges : & [ ( u32 , u32 ) ] ) -> Relation < ( u32 , u32 ) > {
14- let edges: Relation < _ > = edges. iter ( ) . collect ( ) ;
14+ let edges: Relation < ( u32 , u32 ) > = edges. iter ( ) . collect ( ) ;
1515 let mut iteration = Iteration :: new ( ) ;
1616
1717 let edges_by_successor = iteration. variable :: < ( u32 , u32 ) > ( "edges_invert" ) ;
@@ -22,15 +22,15 @@ fn reachable_with_var_join(edges: &[(u32, u32)]) -> Relation<(u32, u32)> {
2222
2323 while iteration. changed ( ) {
2424 // reachable(N1, N3) :- edges(N1, N2), reachable(N2, N3).
25- reachable. from_join ( & reachable, & edges_by_successor, |& _ , & n3, & n1| ( n1, n3) ) ;
25+ reachable. from_join ( & reachable, & edges_by_successor, |_ : ( u32 , ) , n3, n1| ( n1, n3) ) ;
2626 }
2727
2828 reachable. complete ( )
2929}
3030
3131/// Like `reachable`, but using a relation as an input to `from_join`
3232fn reachable_with_relation_join ( edges : & [ ( u32 , u32 ) ] ) -> Relation < ( u32 , u32 ) > {
33- let edges: Relation < _ > = edges. iter ( ) . collect ( ) ;
33+ let edges: Relation < ( u32 , u32 ) > = edges. iter ( ) . collect ( ) ;
3434 let mut iteration = Iteration :: new ( ) ;
3535
3636 // NB. Changed from `reachable_with_var_join`:
@@ -41,7 +41,7 @@ fn reachable_with_relation_join(edges: &[(u32, u32)]) -> Relation<(u32, u32)> {
4141
4242 while iteration. changed ( ) {
4343 // reachable(N1, N3) :- edges(N1, N2), reachable(N2, N3).
44- reachable. from_join ( & reachable, & edges_by_successor, |& _ , & n3, & n1| ( n1, n3) ) ;
44+ reachable. from_join ( & reachable, & edges_by_successor, |_ : ( u32 , ) , n3, n1| ( n1, n3) ) ;
4545 }
4646
4747 reachable. complete ( )
@@ -60,7 +60,7 @@ fn reachable_with_leapfrog(edges: &[(u32, u32)]) -> Relation<(u32, u32)> {
6060 // reachable(N1, N3) :- edges(N1, N2), reachable(N2, N3).
6161 reachable. from_leapjoin (
6262 & reachable,
63- edges_by_successor. extend_with ( |& ( n2, _) | n2 ) ,
63+ edges_by_successor. extend_with ( |& ( n2, _) | ( n2 , ) ) ,
6464 |& ( _, n3) , & n1| ( n1, n3) ,
6565 ) ;
6666 }
@@ -86,7 +86,7 @@ fn sum_join_via_var(
8686
8787 while iteration. changed ( ) {
8888 // output(K1, V1 * 100 + V2) :- input1(K1, V1), input2(K1, V2).
89- output. from_join ( & input1, & input2, |& k1, & v1, & v2| ( k1, v1 * 100 + v2) ) ;
89+ output. from_join ( & input1, & input2, |( k1, ) , v1, v2| ( k1, v1 * 100 + v2) ) ;
9090 }
9191
9292 output. complete ( )
@@ -98,9 +98,9 @@ fn sum_join_via_relation(
9898 input1_slice : & [ ( u32 , u32 ) ] ,
9999 input2_slice : & [ ( u32 , u32 ) ] ,
100100) -> Relation < ( u32 , u32 ) > {
101- let input1: Relation < _ > = input1_slice. iter ( ) . collect ( ) ;
102- let input2: Relation < _ > = input2_slice. iter ( ) . collect ( ) ;
103- Relation :: from_join ( & input1, & input2, |& k1, & v1, & v2| ( k1, v1 * 100 + v2) )
101+ let input1: Relation < ( u32 , u32 ) > = input1_slice. iter ( ) . collect ( ) ;
102+ let input2: Relation < ( u32 , u32 ) > = input2_slice. iter ( ) . collect ( ) ;
103+ Relation :: from_join ( & input1, & input2, |( k1, ) , v1, v2| ( k1, v1 * 100 + v2) )
104104}
105105
106106proptest ! {
@@ -183,7 +183,7 @@ fn leapjoin_from_extend() {
183183 while iteration. changed ( ) {
184184 variable. from_leapjoin (
185185 & variable,
186- doubles. extend_with ( |& ( i, _) | i ) ,
186+ doubles. extend_with ( |& ( i, _) | ( i , ) ) ,
187187 |& ( i, _) , & j| ( i, j) ,
188188 ) ;
189189 }
@@ -221,11 +221,11 @@ fn passthrough_leaper() {
221221
222222#[ test]
223223fn relation_from_antijoin ( ) {
224- let lhs: Relation < _ > = ( 0 .. 10 ) . map ( |x| ( x, x) ) . collect ( ) ;
225- let rhs: Relation < _ > = ( 0 .. 10 ) . filter ( |x| x % 2 == 0 ) . collect ( ) ;
224+ let lhs: Relation < ( u32 , u32 ) > = ( 0 .. 10 ) . map ( |x| ( x, x) ) . collect ( ) ;
225+ let rhs: Relation < ( u32 , ) > = ( 0 .. 10 ) . filter ( |x| x % 2 == 0 ) . map ( |x| ( x , ) ) . collect ( ) ;
226226 let expected: Relation < _ > = ( 0 .. 10 ) . filter ( |x| x % 2 == 1 ) . map ( |x| ( x, x) ) . collect ( ) ;
227227
228- let result = Relation :: from_antijoin ( & lhs, & rhs, |a , b| ( * a , * b ) ) ;
228+ let result = Relation :: from_antijoin ( & lhs, & rhs, |x| x ) ;
229229
230230 assert_eq ! ( result. elements, expected. elements) ;
231231}
0 commit comments