Skip to content

Why are Sinks responsible for maintaining statistics, when isn't part of the Sink trait definition? #2271

Answered by BurntSushi
BatmanAoD asked this question in Q&A
Discussion options

You must be logged in to vote

why not add a separate trait

When it comes to generics, I never ask "why not." I always ask "why do it in the first place."

Stats don't seem like a fundamental part of "sink" to me. It's true that all of the printers provide stats, but note that not all Sink impls provide stats.

Sorry if this isn't a fulfilling answer, but it really is that simple: IMO you have the burden of proof flipped. :-)

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@BatmanAoD
Comment options

@BurntSushi
Comment options

@BatmanAoD
Comment options

@BurntSushi
Comment options

Answer selected by BatmanAoD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants