pub fn rename_item(
workload_path: &Path,
old_name: &str,
new_name: &str,
replace: bool,
) -> Result<()>Expand description
Rename a report item from old_name to new_name in the
workload at workload_path. SRD-64 §6.6: pure metadata
edit — anchor stays at the existing site.
replace controls collision policy:
false— error ifnew_nameis already in use anywhere in the workload.true— destructive overwrite: drop the existing item atnew_nameand renameold_nameover it. Mutually exclusive with the existing-name path: a destructive rename leaves the workload with one item undernew_name, holding the spec fromold_name.
The collision-target item being a different kind from
old_name is allowed — --replace is the user’s
affirmation that they want the destructive swap regardless.