moved vector clear from generated code to io::writer