Skip to content
Better HN
Top
New
Best
Ask
Show
Jobs
Search
⌘K
undefined | Better HN
0 points
wtetzner
1y ago
0 comments
Share
You would actually use a Result type:
use std::io; pub fn read(path: Path) -> io::Result<Bytes> { File::open(path)?.read_to_end() }
0 comments
default
newest
oldest
tcfhgj
1y ago
Sure, if you are allowed to change the signature, makes it look more ugly than just returning Bytes though
j
/
k
navigate · click thread line to collapse