You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use miette for my crate's error type. My crate parses binary data, and the errors can be quite difficult to understand, so I decided to pull miette in and see how it'd work.
miette's SourceCode impl for [u8] assumes it is string data, which means any users whose source is binary data need to write a custom impl. Atm, I'm stuck trying to figure out how to calculate where the SourceSpan offsets should go. Changing the offsets seems to move it completely- and higher offsets appear earlier in the text than they should?
I'm trying to pass in offsets into the original binary data, but they won't correspond exactly to the stringified version. Does that have something to do with it?
I have no idea what I'm doing, could I get some help?
The text was updated successfully, but these errors were encountered:
Yeah miette doesn't really support pretty-printed text very well--you can technically get things pointing at the right place, but that requires a lot of effort on your part. It's not a surprise you're having trouble with this, and I don't really have a solution for you right now. It's one of those backlog things that are fairly hard problems to solve.
I'm trying to use miette for my crate's error type. My crate parses binary data, and the errors can be quite difficult to understand, so I decided to pull miette in and see how it'd work.
miette's
SourceCode
impl for[u8]
assumes it is string data, which means any users whose source is binary data need to write a custom impl. Atm, I'm stuck trying to figure out how to calculate where theSourceSpan
offsets should go. Changing the offsets seems to move it completely- and higher offsets appear earlier in the text than they should?I'm trying to pass in offsets into the original binary data, but they won't correspond exactly to the stringified version. Does that have something to do with it?
I have no idea what I'm doing, could I get some help?
The text was updated successfully, but these errors were encountered: