@@ -64,14 +64,14 @@ pub mod filters {
64
64
use super :: Leaper ;
65
65
66
66
/// 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 > {
68
68
phantom : :: std:: marker:: PhantomData < Tuple > ,
69
69
predicate : Func ,
70
70
}
71
71
72
72
impl < ' a , Tuple , Func > PrefixFilter < Tuple , Func >
73
73
where
74
- Func : Fn ( & Tuple ) -> bool
74
+ Func : Fn ( & Tuple ) -> bool ,
75
75
{
76
76
/// Creates a new filter based on the prefix
77
77
pub fn from ( predicate : Func ) -> Self {
@@ -84,14 +84,13 @@ pub mod filters {
84
84
85
85
impl < ' a , Tuple , Val , Func > Leaper < ' a , Tuple , Val > for PrefixFilter < Tuple , Func >
86
86
where
87
- Func : Fn ( & Tuple ) -> bool
87
+ Func : Fn ( & Tuple ) -> bool ,
88
88
{
89
89
/// Estimates the number of proposed values.
90
90
fn count ( & mut self , prefix : & Tuple ) -> usize {
91
91
if ( self . predicate ) ( prefix) {
92
92
usize:: max_value ( )
93
- }
94
- else {
93
+ } else {
95
94
0
96
95
}
97
96
}
@@ -106,14 +105,14 @@ pub mod filters {
106
105
}
107
106
108
107
/// 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 > {
110
109
phantom : :: std:: marker:: PhantomData < ( Tuple , Val ) > ,
111
110
predicate : Func ,
112
111
}
113
112
114
113
impl < ' a , Tuple , Val , Func > ValueFilter < Tuple , Val , Func >
115
114
where
116
- Func : Fn ( & Tuple , & Val ) -> bool
115
+ Func : Fn ( & Tuple , & Val ) -> bool ,
117
116
{
118
117
/// Creates a new filter based on the prefix
119
118
pub fn from ( predicate : Func ) -> Self {
@@ -126,7 +125,7 @@ pub mod filters {
126
125
127
126
impl < ' a , Tuple , Val , Func > Leaper < ' a , Tuple , Val > for ValueFilter < Tuple , Val , Func >
128
127
where
129
- Func : Fn ( & Tuple , & Val ) -> bool
128
+ Func : Fn ( & Tuple , & Val ) -> bool ,
130
129
{
131
130
/// Estimates the number of proposed values.
132
131
fn count ( & mut self , _prefix : & Tuple ) -> usize {
@@ -144,7 +143,6 @@ pub mod filters {
144
143
145
144
}
146
145
147
-
148
146
/// Extension method for relations.
149
147
pub trait RelationLeaper < Key : Ord , Val : Ord > {
150
148
/// Extend with `Val` using the elements of the relation.
0 commit comments