cnpryer/huak

Clean up parameters order in cli.rs

cnpryer opened this issue · 0 comments

I noticed that in cli.rs (huak-cli crate) there is no formal structure to some of these function signatures. For example some functions will lead with the configuration data:

fn function(config: &Config, param1: Something) -> HuakResult<()> {
}

Others might have Config between other parameters:

fn function(param1: Something, config: &Config, param2: Something) -> HuakResult<()> {
}

And others have Config follow the rest of the parameters:

fn function(param1: Something, config: &Config) -> HuakResult<()> {
}

It'd be nice to structure this module a bit better. Either [a-z] for command parameters and end with Config or order the rest of the parameters by what feels natural for that command. Either way I think Config data should be last.