Skip to main content

read_stdin

Function read_stdin 

Source
pub fn read_stdin() -> Result<Vec<u8>>
Expand description

Read all bytes from stdin into a Vec. Pre-allocates 16MB to avoid the repeated reallocation overhead of Vec’s default growth strategy (which doubles from 0 -> 8K -> 16K -> …), causing multiple memcpy of already-read data for large piped inputs.