Skip to content

Commit 2b407d7

Browse files
committed
apply cargo fmt
1 parent a96206c commit 2b407d7

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/lib.rs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
use std::cell::RefCell;
1515
use std::cmp::Ordering;
16-
use std::rc::Rc;
1716
use std::iter::FromIterator;
17+
use std::rc::Rc;
1818

1919
mod join;
2020
mod map;
@@ -44,8 +44,12 @@ pub struct Relation<Tuple: Ord> {
4444
impl<Tuple: Ord> Relation<Tuple> {
4545
/// Merges two relations into their union.
4646
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;
4953

5054
// If one of the element lists is zero-length, we don't need to do any work
5155
if elements1.is_empty() {
@@ -105,7 +109,7 @@ impl<Tuple: Ord> Relation<Tuple> {
105109
/// Same as the `from_iter` method from `std::iter::FromIterator` trait.
106110
pub fn from_iter<I>(iterator: I) -> Self
107111
where
108-
I: IntoIterator<Item = Tuple>
112+
I: IntoIterator<Item = Tuple>,
109113
{
110114
iterator.into_iter().collect()
111115
}
@@ -169,7 +173,7 @@ impl<Tuple: Ord> From<Vec<Tuple>> for Relation<Tuple> {
169173
impl<Tuple: Ord> FromIterator<Tuple> for Relation<Tuple> {
170174
fn from_iter<I>(iterator: I) -> Self
171175
where
172-
I: IntoIterator<Item = Tuple>
176+
I: IntoIterator<Item = Tuple>,
173177
{
174178
Relation::from_vec(iterator.into_iter().collect())
175179
}
@@ -178,7 +182,7 @@ impl<Tuple: Ord> FromIterator<Tuple> for Relation<Tuple> {
178182
impl<'tuple, Tuple: 'tuple + Copy + Ord> FromIterator<&'tuple Tuple> for Relation<Tuple> {
179183
fn from_iter<I>(iterator: I) -> Self
180184
where
181-
I: IntoIterator<Item = &'tuple Tuple>
185+
I: IntoIterator<Item = &'tuple Tuple>,
182186
{
183187
Relation::from_vec(iterator.into_iter().cloned().collect())
184188
}
@@ -469,7 +473,8 @@ impl<Tuple: Ord> Variable<Tuple> {
469473
/// it is not obvious that it should be commonly used otherwise, but
470474
/// it should not be harmful.
471475
pub fn extend<T>(&self, iterator: impl IntoIterator<Item = T>)
472-
where Relation<Tuple>: FromIterator<T>
476+
where
477+
Relation<Tuple>: FromIterator<T>,
473478
{
474479
self.insert(iterator.into_iter().collect());
475480
}

0 commit comments

Comments
 (0)