4 ms·
You can chain calls in Rust. If read_to_end were written to allocate and return a fresh Vec, you could do this: File::open(path)?.read_to_end() but instea
by scottlamb 5y ago
You can chain calls in Rust. If read_to_end were written to allocate and return a fresh Vec, you could do this:
File::open(path)?.read_to_end()
but instead read_to_end is written to take a presupplied Vec so the caller has the option to reduce allocations.