codevis
codevis copied to clipboard
Make Prodash "impl prodash::Progress" optional?
Not everyone may be interested in using Prodash, or creating an instance of impl prodash::Progress before calling our render function. So wrapping that paramater in an Option may make more sense.
What do you think of this @Byron? Is this a good idea or is there a better way to do this?
Even though I don't fully understand the problem, I think what you might be looking for is DoOrDiscard.
It's easy to ignore progress entirely with Discard as well.
A program that uses Discard will pay nothing for progress handling as all operations are no-ops. In applications that support turning progress on or off, DoOrDiscard is usually the solution, along with bringing up the renderer conditionally.