Closed okamt closed 1 week ago
@okamt those are private not out of nothing, but for the ability to toss them around without introducing breaking changes to the library API. Could you elaborate more on your use case? Give some example?
Sure, in my case I have a function that returns something like Result<T, FromStrError>
, in the case of a FromStrError I'd like to extract the string that caused the error to put it in a more descriptive/specific error type
Oh, I just realized the error doesn't store the wrong string at all... lol
Synopsis
Can't access strings in error types, useful for mapping to another error type or if you want to change the Display impl
Solution
Make strings in the dedicated error type structs (FromStrError, TryIntoError etc.) public.
Checklist
none are applicable, I think