pub async fn execute_sync(manifest_path: &str) -> Result<SyncReport, SyncError>Expand description
Align every local path-only entry under [workspace.dependencies]
with the workspace version, and (optionally) the dep alias with the
member crate’s actual [package].name.
§Arguments
&str: Path to the workspace root Cargo.toml.
§Returns
Result<SyncReport, SyncError>: Summary of what was rewritten.
§Behavior
- Reads
[workspace.package].version. Errors out if it is missing. - Reads
[workspace.members]. Errors out if it is missing. - For each member path:
- Opens
<member_path>/Cargo.tomland reads its[package].name. - Locates the existing
[workspace.dependencies]entry whosepath = "<member_path>"and captures its current LHS alias. - If the entry is already aligned (alias + version both correct), skip it.
- Otherwise rewrite the entry: align
versionto the workspace version, and rename the LHS alias to match the crate’s[package].namewhen the alias differs.
- Opens
file_changedis true iff at least one rename or version-rewrite actually happened (so a no-op run is genuinely idempotent and does not write the file).