quiche icon indicating copy to clipboard operation
quiche copied to clipboard

make path and cid maps infallible

Open ehaydenr opened this issue 2 years ago • 0 comments

No functional change. Changes path and cid maps to return Option instead of Result with InvalidState. This is more consistent with the streams map, pushes the error case higher up in the call stack, and better reflects what is being returned. For cases where you want to simply check the existence of a path or cid, an Option is more natural because there are only two variants: Some or None. When a Result is returned, any error could be returned. While in most instances, doc comments indicate that the only Error is InvalidState, this seems like an unnecessary mental burden.

ehaydenr avatar Mar 09 '23 18:03 ehaydenr