Description
When a manifest contains a [package] table but no blank line or subsequent table is found, synthesize_manifest appends the synthesized license field at the end of the manifest.
The append branch writes the opening quote but not the closing quote:
existing.push_str("license = \"");
let offset = existing.len();
writeln!(&mut existing, "{expression}\n").unwrap();
As a result, the synthesized manifest is invalid TOML:
[package]
name = "example"
version = "0.1.0"
license = "MIT
This was introduced in #299, which replaced the previous toml_edit implementation with manual string manipulation.
Expected behavior
The synthesized license value should be valid TOML and include its closing quote.
Suggested fix
Write the closing quote as part of the formatted line:
existing.push_str("license = \"");
let offset = existing.len();
writeln!(&mut existing, "{expression}\"").unwrap();
Description
When a manifest contains a
[package]table but no blank line or subsequent table is found,synthesize_manifestappends the synthesized license field at the end of the manifest.The append branch writes the opening quote but not the closing quote:
As a result, the synthesized manifest is invalid TOML:
This was introduced in #299, which replaced the previous
toml_editimplementation with manual string manipulation.Expected behavior
The synthesized
licensevalue should be valid TOML and include its closing quote.Suggested fix
Write the closing quote as part of the formatted line: