Skip to content

Commit 6f03cce

Browse files
committed
Removed root related flags
1 parent 008a126 commit 6f03cce

File tree

2 files changed

+1
-25
lines changed

2 files changed

+1
-25
lines changed

src/cargo/core/resolver/encode.rs

+1-24
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ use super::Resolve;
1414
#[derive(Serialize, Deserialize, Debug)]
1515
pub struct EncodableResolve {
1616
package: Option<Vec<EncodableDependency>>,
17-
/// `root` is optional to allow forward compatibility.
18-
root: Option<EncodableDependency>,
1917
metadata: Option<Metadata>,
2018

2119
#[serde(default, skip_serializing_if = "Patch::is_empty")]
@@ -33,13 +31,7 @@ impl EncodableResolve {
3331
pub fn into_resolve(self, ws: &Workspace) -> CargoResult<Resolve> {
3432
let path_deps = build_path_deps(ws);
3533

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();
4335

4436
// `PackageId`s in the lock file don't include the `source` part
4537
// for workspace members, so we reconstruct proper ids.
@@ -311,7 +303,6 @@ impl<'de> de::Deserialize<'de> for EncodablePackageId {
311303
pub struct WorkspaceResolve<'a, 'cfg: 'a> {
312304
pub ws: &'a Workspace<'cfg>,
313305
pub resolve: &'a Resolve,
314-
pub use_root_key: bool,
315306
}
316307

317308
impl<'a, 'cfg> ser::Serialize for WorkspaceResolve<'a, 'cfg> {
@@ -321,15 +312,7 @@ impl<'a, 'cfg> ser::Serialize for WorkspaceResolve<'a, 'cfg> {
321312
let mut ids: Vec<&PackageId> = self.resolve.graph.iter().collect();
322313
ids.sort();
323314

324-
let root = self.ws.members().max_by_key(|member| {
325-
member.name()
326-
}).map(Package::package_id);
327-
328315
let encodable = ids.iter().filter_map(|&id| {
329-
if self.use_root_key && root.unwrap() == id {
330-
return None
331-
}
332-
333316
Some(encodable_resolve_node(id, self.resolve))
334317
}).collect::<Vec<_>>();
335318

@@ -347,11 +330,6 @@ impl<'a, 'cfg> ser::Serialize for WorkspaceResolve<'a, 'cfg> {
347330

348331
let metadata = if metadata.is_empty() { None } else { Some(metadata) };
349332

350-
let root = match root {
351-
Some(root) if self.use_root_key => Some(encodable_resolve_node(root, self.resolve)),
352-
_ => None,
353-
};
354-
355333
let patch = Patch {
356334
unused: self.resolve.unused_patches().iter().map(|id| {
357335
EncodableDependency {
@@ -365,7 +343,6 @@ impl<'a, 'cfg> ser::Serialize for WorkspaceResolve<'a, 'cfg> {
365343
};
366344
EncodableResolve {
367345
package: Some(encodable),
368-
root: root,
369346
metadata: metadata,
370347
patch: patch,
371348
}.serialize(s)

src/cargo/ops/lockfile.rs

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ pub fn write_pkg_lockfile(ws: &Workspace, resolve: &Resolve) -> CargoResult<()>
4343
let toml = toml::Value::try_from(WorkspaceResolve {
4444
ws: ws,
4545
resolve: resolve,
46-
use_root_key: false,
4746
}).unwrap();
4847

4948
let mut out = String::new();

0 commit comments

Comments
 (0)