Hacker News new | ask | show | jobs
by gary_0 664 days ago

    pub fn read(path: Path) -> Result<Bytes> {
      File::open(path)?.read_to_end()
    }
isn't so bad either.
1 comments

Exactly, and this is in my experience what most Rust code ends up looking like.

It compromises a bit on generality and (potential) performance to achieve better readability and succinctness. Often a worthwhile trade-off, but not something the standard library can always do.