Skip to content

Commit cda06b6

Browse files
committed
cargo fmt
1 parent 5f8df47 commit cda06b6

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

src/lib.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@ mod join;
1919
mod map;
2020
mod treefrog;
2121
pub use treefrog::{
22-
extend_anti::ExtendAnti, extend_with::ExtendWith, filter_anti::FilterAnti,
23-
filter_with::FilterWith, Leaper, RelationLeaper,
22+
extend_anti::ExtendAnti,
23+
extend_with::ExtendWith,
24+
filter_anti::FilterAnti,
25+
filter_with::FilterWith,
2426
filters::{PrefixFilter, ValueFilter},
27+
Leaper, RelationLeaper,
2528
};
2629

2730
/// A static, ordered list of key-value pairs.

src/treefrog.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ pub mod filters {
6464
use super::Leaper;
6565

6666
/// A treefrog leaper based on a per-prefix predicate.
67-
pub struct PrefixFilter<Tuple, Func: Fn(&Tuple)->bool> {
67+
pub struct PrefixFilter<Tuple, Func: Fn(&Tuple) -> bool> {
6868
phantom: ::std::marker::PhantomData<Tuple>,
6969
predicate: Func,
7070
}
7171

7272
impl<'a, Tuple, Func> PrefixFilter<Tuple, Func>
7373
where
74-
Func: Fn(&Tuple) -> bool
74+
Func: Fn(&Tuple) -> bool,
7575
{
7676
/// Creates a new filter based on the prefix
7777
pub fn from(predicate: Func) -> Self {
@@ -84,14 +84,13 @@ pub mod filters {
8484

8585
impl<'a, Tuple, Val, Func> Leaper<'a, Tuple, Val> for PrefixFilter<Tuple, Func>
8686
where
87-
Func: Fn(&Tuple) -> bool
87+
Func: Fn(&Tuple) -> bool,
8888
{
8989
/// Estimates the number of proposed values.
9090
fn count(&mut self, prefix: &Tuple) -> usize {
9191
if (self.predicate)(prefix) {
9292
usize::max_value()
93-
}
94-
else {
93+
} else {
9594
0
9695
}
9796
}
@@ -106,14 +105,14 @@ pub mod filters {
106105
}
107106

108107
/// A treefrog leaper based on a predicate of prefix and value.
109-
pub struct ValueFilter<Tuple, Val, Func: Fn(&Tuple, &Val)->bool> {
108+
pub struct ValueFilter<Tuple, Val, Func: Fn(&Tuple, &Val) -> bool> {
110109
phantom: ::std::marker::PhantomData<(Tuple, Val)>,
111110
predicate: Func,
112111
}
113112

114113
impl<'a, Tuple, Val, Func> ValueFilter<Tuple, Val, Func>
115114
where
116-
Func: Fn(&Tuple, &Val) -> bool
115+
Func: Fn(&Tuple, &Val) -> bool,
117116
{
118117
/// Creates a new filter based on the prefix
119118
pub fn from(predicate: Func) -> Self {
@@ -126,7 +125,7 @@ pub mod filters {
126125

127126
impl<'a, Tuple, Val, Func> Leaper<'a, Tuple, Val> for ValueFilter<Tuple, Val, Func>
128127
where
129-
Func: Fn(&Tuple, &Val) -> bool
128+
Func: Fn(&Tuple, &Val) -> bool,
130129
{
131130
/// Estimates the number of proposed values.
132131
fn count(&mut self, _prefix: &Tuple) -> usize {
@@ -144,7 +143,6 @@ pub mod filters {
144143

145144
}
146145

147-
148146
/// Extension method for relations.
149147
pub trait RelationLeaper<Key: Ord, Val: Ord> {
150148
/// Extend with `Val` using the elements of the relation.

0 commit comments

Comments
 (0)