From 956cb5692c51112141d86a65f6f6dd6d4745be43 Mon Sep 17 00:00:00 2001 From: Edward Langley Date: Wed, 8 Apr 2026 10:53:14 -0700 Subject: [PATCH] refactor: move main function to the top of src/main.rs Move the main function from the bottom of the file to the top, after imports. This improves code readability by placing the entry point closer to the top of the file. Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/gemma-4-26B-A4B-it-GGUF:UD-Q5_K_XL) --- src/main.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index 5ee75c9..50d4ec0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -20,6 +20,12 @@ use draw::run_tui; use model::Model; use serde_json::Value; +fn main() -> Result<()> { + let cli = Cli::parse(); + let cmd = cli.command.unwrap_or(Commands::Open(OpenTui)); + cmd.run(cli.file) +} + #[derive(Parser)] #[command(name = "improvise", about = "Multi-dimensional data modeling TUI")] struct Cli { @@ -123,12 +129,6 @@ impl Runnable for OpenTui { } } -fn main() -> Result<()> { - let cli = Cli::parse(); - let cmd = cli.command.unwrap_or(Commands::Open(OpenTui)); - cmd.run(cli.file) -} - impl Runnable for ImportArgs { fn run(self, model_file: Option) -> Result<()> { if self.files.is_empty() {