This week's type of the day is `Result<Option<Result<Bytes>>>`

@mauve this is just a less efficient encoding of `Result<Bytes, E>` for some `E`

@jeremy_list In this case each layer has a different meaning it's basically Didn't Time Out ( Stream still Open ( IO read didn't fail (Bytes)))

@mauve I'd personally only handle it that way if some other crate I was using made it unusually difficult not to. Most of the time squashing it to one layer and pushing that completely into the error type instead ends up simplifying things overall.

Follow

@jeremy_list Good point I could probably wrap it in a macro to map the option and flatten it all.

· · Web · 0 · 0 · 1
Sign in to participate in the conversation
Mauvestodon

Escape ship from centralized social media run by Mauve.