Open teohhanhui opened 3 months ago
Currently:
fn main() { let console_handler = handler!(Console { print(s, _) => println!("{s}"), }); let with_console = handle_group(do_command(), console_handler); let cli_options_handler = handler!(CliOptions { read() => options().run(), }); let with_cli_options = handle_group(with_console, cli_options_handler); effing_mad::run(with_cli_options); }
What if:
fn main() { let console_handler = handler!(Console { print(s, _) => println!("{s}"), }); let cli_options_handler = handler!(CliOptions { read() => options().run(), }); effing_mad::run!( do_command() |> handle_group(console_handler) |> handle_group(cli_options_handler) ); }
And mainly because naming is hard... There is nothing special about with_cli_options in the previous code other than it just happens to be the last in the chain?
with_cli_options
Uhh, I guess it's just https://github.com/rust-lang/rfcs/pull/2656
Which I was already following anyway...
Currently:
What if:
And mainly because naming is hard... There is nothing special about
with_cli_options
in the previous code other than it just happens to be the last in the chain?