diff options
author | Daniel Mueller <deso@posteo.net> | 2019-01-06 16:05:36 -0800 |
---|---|---|
committer | Daniel Mueller <deso@posteo.net> | 2019-01-06 16:05:36 -0800 |
commit | 350b3039ea0bc88c830bb3b4003af02b1000fd48 (patch) | |
tree | e99e9dc64bedc7a33fc1f9e9713fa0c673aa8fb3 /rand/rand_distr/src | |
parent | 21a68c0cdd6237313a4cfad2de108b3785b75b49 (diff) | |
download | nitrocli-350b3039ea0bc88c830bb3b4003af02b1000fd48.tar.gz nitrocli-350b3039ea0bc88c830bb3b4003af02b1000fd48.tar.bz2 |
Auto generate argument enums
The argparse module we use for parsing events expects an enum in order
to convey what subcommand has been supplied as an argument. Such an enum
also needs to implement str::FromStr and, preferably, fmt::Display.
Manually writing down those definitions is error-prone, tedious, and
adds no value -- only lines of code.
As it turns out the proper definitions can be generated with relative
easy with a declarative macro, making the code much more concise. Hence,
with this change we use a newly introduced macro for generating those
enums.
Diffstat (limited to 'rand/rand_distr/src')
0 files changed, 0 insertions, 0 deletions