Skip to main content

render_release_declaration

Function render_release_declaration 

Source
pub fn render_release_declaration(declared: &Declaration) -> Result<String>
Expand description

Render a declaration back as the TOML document it declares.

A producer’s comments are not preserved, because they were never read. A declaration is mostly prose — the reasoning about what is a target and what is not — and this answers with the declaration alone, so writing the result over a producer’s own file deletes that reasoning. It is for producing a declaration; editing one is a job for a person.

What it does promise is that the result reads as the same declaration, and it keeps that promise by holding what it was handed to a document’s own checks first: a Declaration a caller built rather than read is refused here if it is one no repository could mean, rather than written out as a document nothing can read back.