I think I've only used the #[path]
attribute once in legitimate code, and that was because I wanted to share some type definitions between a crate and its helper proc macro without creating a third "common" crate that both depend on.
That's a good point. Although I find the OsStr
versions not overly useful because you need to turn it into a String
if you want to use it for anything other than a file name.
So your options are to either ignore the non-UTF8 OsStr
, panic, bail with an error, or silently corrupt the input by substituting �. Not ideal.