Skip to content

Commit 8cc2f39

Browse files
committed
docs(toml): Clarify what resolving a TOML means
1 parent 06a5714 commit 8cc2f39

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/cargo/core/manifest.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,7 @@ impl Manifest {
483483
pub fn contents(&self) -> &str {
484484
self.contents.as_str()
485485
}
486+
/// See [`Manifest::resolved_toml`] for what "resolved" means
486487
pub fn to_resolved_contents(&self) -> CargoResult<String> {
487488
let toml = toml::to_string_pretty(self.resolved_toml())?;
488489
Ok(format!("{}\n{}", MANIFEST_PREAMBLE, toml))
@@ -496,6 +497,11 @@ impl Manifest {
496497
&self.original_toml
497498
}
498499
/// The [`TomlManifest`] with all fields expanded
500+
///
501+
/// This is the intersection of what fields need resolving for cargo-publish that also are
502+
/// useful for the operation of cargo, including
503+
/// - workspace inheritance
504+
/// - target discovery
499505
pub fn resolved_toml(&self) -> &TomlManifest {
500506
&self.resolved_toml
501507
}

src/cargo/util/toml/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ fn to_workspace_root_config(
256256
ws_root_config
257257
}
258258

259+
/// See [`Manifest::resolved_toml`] for more details
259260
#[tracing::instrument(skip_all)]
260261
fn resolve_toml(
261262
original_toml: &manifest::TomlManifest,

0 commit comments

Comments
 (0)