codevis icon indicating copy to clipboard operation
codevis copied to clipboard

Make Prodash "impl prodash::Progress" optional?

Open sloganking opened this issue 2 years ago • 2 comments

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.

sloganking avatar Sep 16 '22 22:09 sloganking

What do you think of this @Byron? Is this a good idea or is there a better way to do this?

sloganking avatar Sep 16 '22 22:09 sloganking

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.

Byron avatar Sep 17 '22 01:09 Byron