Replies: 1 comment 2 replies
-
Technically, there might be a way to support something like this but it would likely involve a lot of complexity and be fairly niche. Is there a reason you couldn't make it |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Sorry for the probably slightly confusing title. I am looking for somewhat of the "best" option for the following problem.
I have some code looking something like this:
The idea would be that the type is specificed via an argument of a flag, e.g.,
-t xml
. The type should then be retrievable byargs.type
and thedo_fancy_stuff
function could be called without any further boilerplate.I tried to use generics for this and have the trait being the flag's type but that probably makes things even more complicated than necessary. It looked somewhat liked this:
Beta Was this translation helpful? Give feedback.
All reactions