top | item 41398323

(no title)

remcob | 1 year ago

Why stop there and not go all the way to

    pub fn read(path: Path) -> Bytes {
      File::open(path).read_to_end()
    }

discuss

order

oneshtein|1 year ago

How to return an error in your example?

gary_0|1 year ago

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

tcfhgj|1 year ago

Throw an exception

proving the point of the article even further