f67d38b35cc5
menu_tree.rs
//! Print FilmCraft's menu bar as it ships (English, default preferences) as JSON: one object per
//! item with its `id`, `label` and menu `path`. `cargo xtask parity` reads this to measure menu
//! coverage against a reference list.
//!
//! ```sh
//! cargo run -p filmcraft-ui-egui --example menu_tree
//! ```
use std::process::ExitCode;
use serde_json::json;
fn main() -> ExitCode {
let items: Vec<serde_json::Value> =
filmcraft_ui_egui::menus::default_menu_items().into_iter().map(|it| json!({"id": it.id, "label": it.label, "path": it.path})).collect();
match serde_json::to_string_pretty(&items) {
Ok(text) => {
println!("{text}");
ExitCode::SUCCESS
}
Err(e) => {
eprintln!("menu_tree: {e}");
ExitCode::FAILURE
}
}
}
No file is open. Choose one in the tree, or press Ctrl+O (⌘O on a Mac) to find one by name.
Syntax highlighting could not load. The unmodified read-only text remains available above.