Hacker News new | past | comments | ask | show | jobs | submit login

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.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: