avoid unnecessary struct when implementing countingWriter (Thanks Mero)