Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
wtetzner
on Aug 30, 2024
|
parent
|
context
|
favorite
| on:
Rust's Ugly Syntax (2023)
You would actually use a Result type:
use std::io; pub fn read(path: Path) -> io::Result<Bytes> { File::open(path)?.read_to_end() }
tcfhgj
on Aug 30, 2024
[–]
Sure, if you are allowed to change the signature, makes it look more ugly than just returning Bytes though
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: