Get the latest tech news
Zig's New Writer
Karl Seguin's Blog - A mix of coding and creative writing
It doesn't apply to Zig 0.14.x (or any previous version) and is likely to be outdated as more of the Io namespace is reworked. The simplest way to implement drain, and what a lot of the Zig standard library has been upgraded to while this larger overhaul takes place, is: We ignore the splat parameter, and just write the first value in data( data.len > 0 is guaranteed to be true).
Or read this on Hacker News