Skip to content

Commit 224cb99

Browse files
committed
Inline load_workspace_metadata() into Workspace::new()
1 parent 6813765 commit 224cb99

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/cargo/core/workspace.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ impl<'cfg> Workspace<'cfg> {
159159
ws.root_manifest = ws.find_root(manifest_path)?;
160160
}
161161

162-
ws.load_workspace_metadata()?;
162+
ws.custom_metadata = ws.load_workspace_config()?.and_then(|cfg| cfg.custom_metadata);
163163
ws.find_members()?;
164164
ws.resolve_behavior = match ws.root_maybe() {
165165
MaybePackage::Package(p) => p.manifest().resolve_behavior(),
@@ -498,15 +498,6 @@ impl<'cfg> Workspace<'cfg> {
498498
Ok(None)
499499
}
500500

501-
/// After the root of a workspace has been located, sets the custom_metadata, if it exists.
502-
pub fn load_workspace_metadata(&mut self) -> CargoResult<()> {
503-
if let Some(workspace_config) = self.load_workspace_config()? {
504-
self.custom_metadata = workspace_config.custom_metadata;
505-
}
506-
507-
Ok(())
508-
}
509-
510501
/// After the root of a workspace has been located, probes for all members
511502
/// of a workspace.
512503
///

0 commit comments

Comments
 (0)