Hi,
Thank you. The reason I'm passing the err_flag is that I'm passing one time stderr, stdout.
But I think your reply helped me figure out how to do it. Thanks!
Instead of just passing in what the generic supposedly is in some separate way,
Use enums instead of generics, or
Use a trait bound that can supply the information of what the generic is in some way
A key idea of either approach is to make a logical mismatch between the generic and the ability to find out "what is this" impossible in your API / to avoid the need to manually keep them in sync.
I also suggest you
Return Result as opposed to updating a &mut status parameter