annotate-snippets-rs
annotate-snippets-rs copied to clipboard
Support `Path` origins
I'd like to have a function return a Snippet but origin is a &str and I have a PathBuf. I can convert it to a Cow<str> but I wouldn't be able to return the Snippet.
IMO, storing origin in a Path or PathBuf does not make sense here. These snippet will be printed on the console. As such, they must be UTF-8 valid.
However, being able to store origin in a Cow<str> may solve your problem.