Backport #870 (optional project names) to 7.4.x (#871)

Unlike most of the other backports, this code couldn't be directly
translated so it had to be re-implemented. Luckily, it is very simple.
This implementation is a bit messy and heavy handed with potential
panics, but I think it's probably fine since file names that aren't
UTF-8 aren't really supported anyway. The original implementation is a
lot cleaner though.

The test snapshots are (almost) all identical between the 7.5
implementation and this one. The sole exception is with the path in the
`snapshot_middleware::project` test, since I didn't feel like adding a
`name` parameter to `snapshot_project` in this implementation.
This commit is contained in:
Micah
2024-02-20 17:25:05 -08:00
committed by GitHub
parent 88efbd433f
commit 9509909f46
26 changed files with 459 additions and 5 deletions

View File

@@ -39,7 +39,7 @@ enum Error {
#[serde(deny_unknown_fields, rename_all = "camelCase")]
pub struct Project {
/// The name of the top-level instance described by the project.
pub name: String,
pub name: Option<String>,
/// The tree of instances described by this project. Projects always
/// describe at least one instance.