Y
Hacker News
new
|
ask
|
show
|
jobs
by
wtetzner
650 days ago
You would actually use a Result type:
use std::io; pub fn read(path: Path) -> io::Result<Bytes> { File::open(path)?.read_to_end() }
1 comments
tcfhgj
650 days ago
Sure, if you are allowed to change the signature, makes it look more ugly than just returning Bytes though
link