diff options
| author | pml68 <contact@pml68.dev> | 2025-04-18 00:54:37 +0200 |
|---|---|---|
| committer | pml68 <contact@pml68.dev> | 2025-04-18 00:54:37 +0200 |
| commit | ec063de6a3cccd6d51bd494573fb0b2c40cfc7a6 (patch) | |
| tree | a48fd0b20ff96d7d24b73317bdd2de78736ef3c9 /src/types | |
| parent | refactor: load config in `IcedBuilder::init` instead of `main` (diff) | |
| download | iced-builder-ec063de6a3cccd6d51bd494573fb0b2c40cfc7a6.tar.gz | |
feat(debug): add custom "Code Generation" Comet debug metric
Diffstat (limited to 'src/types')
| -rw-r--r-- | src/types/project.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/types/project.rs b/src/types/project.rs index 145ab18..91b2bb1 100644 --- a/src/types/project.rs +++ b/src/types/project.rs @@ -83,7 +83,10 @@ impl Project { } pub fn app_code(&mut self) -> Result<String, Error> { - match self.element_tree { + use iced::debug; + let codegen = debug::time("Code Generation"); + + let result = match self.element_tree { Some(ref element_tree) => { let (imports, view) = element_tree.codegen(); let theme = self.get_theme(); @@ -137,6 +140,9 @@ impl State {{ Ok(rustfmt.format_str(app_code)?) } None => Err("No element tree present".into()), - } + }; + + codegen.finish(); + result } } |
