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)
This commit is contained in:
12
src/main.rs
12
src/main.rs
@ -20,6 +20,12 @@ use draw::run_tui;
|
|||||||
use model::Model;
|
use model::Model;
|
||||||
use serde_json::Value;
|
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)]
|
#[derive(Parser)]
|
||||||
#[command(name = "improvise", about = "Multi-dimensional data modeling TUI")]
|
#[command(name = "improvise", about = "Multi-dimensional data modeling TUI")]
|
||||||
struct Cli {
|
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 {
|
impl Runnable for ImportArgs {
|
||||||
fn run(self, model_file: Option<PathBuf>) -> Result<()> {
|
fn run(self, model_file: Option<PathBuf>) -> Result<()> {
|
||||||
if self.files.is_empty() {
|
if self.files.is_empty() {
|
||||||
|
|||||||
Reference in New Issue
Block a user