File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -231,6 +231,12 @@ impl Database {
231
231
}
232
232
}
233
233
234
+ impl Default for Database {
235
+ fn default ( ) -> Self {
236
+ Database :: new ( PathBuf :: new ( ) , Vec :: new ( ) , |_| Vec :: new ( ) , false )
237
+ }
238
+ }
239
+
234
240
#[ cfg( test) ]
235
241
mod tests {
236
242
use super :: * ;
Original file line number Diff line number Diff line change 1
1
use std:: iter:: Rev ;
2
2
use std:: ops:: Range ;
3
- use std:: path:: { Path , PathBuf } ;
3
+ use std:: path:: Path ;
4
4
use std:: { fs, path} ;
5
5
6
6
use glob:: Pattern ;
@@ -177,8 +177,6 @@ impl StreamOptions {
177
177
178
178
#[ cfg( test) ]
179
179
mod tests {
180
- use std:: path:: PathBuf ;
181
-
182
180
use rstest:: rstest;
183
181
184
182
use super :: * ;
@@ -204,7 +202,7 @@ mod tests {
204
202
#[ case( & [ "/foo/" , "/bar" ] , "/foo/bar" , false ) ]
205
203
#[ case( & [ "/foo/" , "/bar" ] , "/foo/baz/bar" , true ) ]
206
204
fn query ( #[ case] keywords : & [ & str ] , #[ case] path : & str , #[ case] is_match : bool ) {
207
- let db = & mut Database :: new ( PathBuf :: new ( ) , Vec :: new ( ) , |_| Vec :: new ( ) , false ) ;
205
+ let db = & mut Database :: default ( ) ;
208
206
let options = StreamOptions :: new ( 0 ) . with_keywords ( keywords. iter ( ) ) ;
209
207
let stream = Stream :: new ( db, options) ;
210
208
assert_eq ! ( is_match, stream. filter_by_keywords( path) ) ;
You can’t perform that action at this time.
0 commit comments