Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
wtetzner
1y ago
0 comments
Save
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
1 comments · 1 top-level
top
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