@@ -34,8 +34,6 @@ pub struct PathSource<'gctx> {
34
34
updated : bool ,
35
35
/// Packages that this sources has discovered.
36
36
packages : Vec < Package > ,
37
- /// Whether this source should discover nested packages recursively.
38
- recursive : bool ,
39
37
gctx : & ' gctx GlobalContext ,
40
38
}
41
39
@@ -51,15 +49,13 @@ impl<'gctx> PathSource<'gctx> {
51
49
updated : false ,
52
50
packages : Vec :: new ( ) ,
53
51
gctx,
54
- recursive : false ,
55
52
}
56
53
}
57
54
58
55
/// Preloads a package for this source. The source is assumed that it has
59
56
/// yet loaded any other packages.
60
57
pub fn preload_with ( & mut self , pkg : Package ) {
61
58
assert ! ( !self . updated) ;
62
- assert ! ( !self . recursive) ;
63
59
assert ! ( self . packages. is_empty( ) ) ;
64
60
self . updated = true ;
65
61
self . packages . push ( pkg) ;
@@ -85,8 +81,6 @@ impl<'gctx> PathSource<'gctx> {
85
81
pub fn read_packages ( & self ) -> CargoResult < Vec < Package > > {
86
82
if self . updated {
87
83
Ok ( self . packages . clone ( ) )
88
- } else if self . recursive {
89
- ops:: read_packages ( & self . path , self . source_id , self . gctx )
90
84
} else {
91
85
let path = self . path . join ( "Cargo.toml" ) ;
92
86
let pkg = ops:: read_package ( & path, self . source_id , self . gctx ) ?;
@@ -234,8 +228,6 @@ pub struct RecursivePathSource<'gctx> {
234
228
updated : bool ,
235
229
/// Packages that this sources has discovered.
236
230
packages : Vec < Package > ,
237
- /// Whether this source should discover nested packages recursively.
238
- recursive : bool ,
239
231
gctx : & ' gctx GlobalContext ,
240
232
}
241
233
@@ -255,20 +247,9 @@ impl<'gctx> RecursivePathSource<'gctx> {
255
247
updated : false ,
256
248
packages : Vec :: new ( ) ,
257
249
gctx,
258
- recursive : true ,
259
250
}
260
251
}
261
252
262
- /// Preloads a package for this source. The source is assumed that it has
263
- /// yet loaded any other packages.
264
- pub fn preload_with ( & mut self , pkg : Package ) {
265
- assert ! ( !self . updated) ;
266
- assert ! ( !self . recursive) ;
267
- assert ! ( self . packages. is_empty( ) ) ;
268
- self . updated = true ;
269
- self . packages . push ( pkg) ;
270
- }
271
-
272
253
/// Gets the package on the root path.
273
254
pub fn root_package ( & mut self ) -> CargoResult < Package > {
274
255
trace ! ( "root_package; source={:?}" , self ) ;
@@ -289,12 +270,8 @@ impl<'gctx> RecursivePathSource<'gctx> {
289
270
pub fn read_packages ( & self ) -> CargoResult < Vec < Package > > {
290
271
if self . updated {
291
272
Ok ( self . packages . clone ( ) )
292
- } else if self . recursive {
293
- ops:: read_packages ( & self . path , self . source_id , self . gctx )
294
273
} else {
295
- let path = self . path . join ( "Cargo.toml" ) ;
296
- let pkg = ops:: read_package ( & path, self . source_id , self . gctx ) ?;
297
- Ok ( vec ! [ pkg] )
274
+ ops:: read_packages ( & self . path , self . source_id , self . gctx )
298
275
}
299
276
}
300
277
0 commit comments