13
13
14
14
use std:: cell:: RefCell ;
15
15
use std:: cmp:: Ordering ;
16
- use std:: rc:: Rc ;
17
16
use std:: iter:: FromIterator ;
17
+ use std:: rc:: Rc ;
18
18
19
19
mod join;
20
20
mod map;
@@ -44,8 +44,12 @@ pub struct Relation<Tuple: Ord> {
44
44
impl < Tuple : Ord > Relation < Tuple > {
45
45
/// Merges two relations into their union.
46
46
pub fn merge ( self , other : Self ) -> Self {
47
- let Relation { elements : mut elements1 } = self ;
48
- let Relation { elements : mut elements2 } = other;
47
+ let Relation {
48
+ elements : mut elements1,
49
+ } = self ;
50
+ let Relation {
51
+ elements : mut elements2,
52
+ } = other;
49
53
50
54
// If one of the element lists is zero-length, we don't need to do any work
51
55
if elements1. is_empty ( ) {
@@ -105,7 +109,7 @@ impl<Tuple: Ord> Relation<Tuple> {
105
109
/// Same as the `from_iter` method from `std::iter::FromIterator` trait.
106
110
pub fn from_iter < I > ( iterator : I ) -> Self
107
111
where
108
- I : IntoIterator < Item = Tuple >
112
+ I : IntoIterator < Item = Tuple > ,
109
113
{
110
114
iterator. into_iter ( ) . collect ( )
111
115
}
@@ -169,7 +173,7 @@ impl<Tuple: Ord> From<Vec<Tuple>> for Relation<Tuple> {
169
173
impl < Tuple : Ord > FromIterator < Tuple > for Relation < Tuple > {
170
174
fn from_iter < I > ( iterator : I ) -> Self
171
175
where
172
- I : IntoIterator < Item = Tuple >
176
+ I : IntoIterator < Item = Tuple > ,
173
177
{
174
178
Relation :: from_vec ( iterator. into_iter ( ) . collect ( ) )
175
179
}
@@ -178,7 +182,7 @@ impl<Tuple: Ord> FromIterator<Tuple> for Relation<Tuple> {
178
182
impl < ' tuple , Tuple : ' tuple + Copy + Ord > FromIterator < & ' tuple Tuple > for Relation < Tuple > {
179
183
fn from_iter < I > ( iterator : I ) -> Self
180
184
where
181
- I : IntoIterator < Item = & ' tuple Tuple >
185
+ I : IntoIterator < Item = & ' tuple Tuple > ,
182
186
{
183
187
Relation :: from_vec ( iterator. into_iter ( ) . cloned ( ) . collect ( ) )
184
188
}
@@ -469,7 +473,8 @@ impl<Tuple: Ord> Variable<Tuple> {
469
473
/// it is not obvious that it should be commonly used otherwise, but
470
474
/// it should not be harmful.
471
475
pub fn extend < T > ( & self , iterator : impl IntoIterator < Item = T > )
472
- where Relation < Tuple > : FromIterator < T >
476
+ where
477
+ Relation < Tuple > : FromIterator < T > ,
473
478
{
474
479
self . insert ( iterator. into_iter ( ) . collect ( ) ) ;
475
480
}
0 commit comments