3 ms·
You would actually use a Result type: use std::io; pub fn read(path: Path) -> io::Result<Bytes> { File::open(path)?.read_to_end() }
by wtetzner 2y 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()
}
- tcfhgj 2y agoSure, if you are allowed to change the signature, makes it look more ugly than just returning Bytes though