@@ -14,8 +14,6 @@ use super::Resolve;
14
14
#[ derive( Serialize , Deserialize , Debug ) ]
15
15
pub struct EncodableResolve {
16
16
package : Option < Vec < EncodableDependency > > ,
17
- /// `root` is optional to allow forward compatibility.
18
- root : Option < EncodableDependency > ,
19
17
metadata : Option < Metadata > ,
20
18
21
19
#[ serde( default , skip_serializing_if = "Patch::is_empty" ) ]
@@ -33,13 +31,7 @@ impl EncodableResolve {
33
31
pub fn into_resolve ( self , ws : & Workspace ) -> CargoResult < Resolve > {
34
32
let path_deps = build_path_deps ( ws) ;
35
33
36
- let packages = {
37
- let mut packages = self . package . unwrap_or_default ( ) ;
38
- if let Some ( root) = self . root {
39
- packages. insert ( 0 , root) ;
40
- }
41
- packages
42
- } ;
34
+ let packages = self . package . unwrap_or_default ( ) ;
43
35
44
36
// `PackageId`s in the lock file don't include the `source` part
45
37
// for workspace members, so we reconstruct proper ids.
@@ -311,7 +303,6 @@ impl<'de> de::Deserialize<'de> for EncodablePackageId {
311
303
pub struct WorkspaceResolve < ' a , ' cfg : ' a > {
312
304
pub ws : & ' a Workspace < ' cfg > ,
313
305
pub resolve : & ' a Resolve ,
314
- pub use_root_key : bool ,
315
306
}
316
307
317
308
impl < ' a , ' cfg > ser:: Serialize for WorkspaceResolve < ' a , ' cfg > {
@@ -321,15 +312,7 @@ impl<'a, 'cfg> ser::Serialize for WorkspaceResolve<'a, 'cfg> {
321
312
let mut ids: Vec < & PackageId > = self . resolve . graph . iter ( ) . collect ( ) ;
322
313
ids. sort ( ) ;
323
314
324
- let root = self . ws . members ( ) . max_by_key ( |member| {
325
- member. name ( )
326
- } ) . map ( Package :: package_id) ;
327
-
328
315
let encodable = ids. iter ( ) . filter_map ( |& id| {
329
- if self . use_root_key && root. unwrap ( ) == id {
330
- return None
331
- }
332
-
333
316
Some ( encodable_resolve_node ( id, self . resolve ) )
334
317
} ) . collect :: < Vec < _ > > ( ) ;
335
318
@@ -347,11 +330,6 @@ impl<'a, 'cfg> ser::Serialize for WorkspaceResolve<'a, 'cfg> {
347
330
348
331
let metadata = if metadata. is_empty ( ) { None } else { Some ( metadata) } ;
349
332
350
- let root = match root {
351
- Some ( root) if self . use_root_key => Some ( encodable_resolve_node ( root, self . resolve ) ) ,
352
- _ => None ,
353
- } ;
354
-
355
333
let patch = Patch {
356
334
unused : self . resolve . unused_patches ( ) . iter ( ) . map ( |id| {
357
335
EncodableDependency {
@@ -365,7 +343,6 @@ impl<'a, 'cfg> ser::Serialize for WorkspaceResolve<'a, 'cfg> {
365
343
} ;
366
344
EncodableResolve {
367
345
package : Some ( encodable) ,
368
- root : root,
369
346
metadata : metadata,
370
347
patch : patch,
371
348
} . serialize ( s)
0 commit comments