annotate-snippets-rs icon indicating copy to clipboard operation
annotate-snippets-rs copied to clipboard

Support `Path` origins

Open epage opened this issue 4 years ago • 1 comments

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.

epage avatar Nov 23 '20 16:11 epage

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.

scrabsha avatar Dec 20 '20 17:12 scrabsha