serde_json has chosen to serialize std::path::Path as a str, if that path doesn't pass the utf-8 check, that causes the whole serialization to error. I've chosen to panic if an error happens during serialization. This PR aims to avoid that panic by checking myself if the path is valid utf-8 and, if it isn't, escape it.
serde_json
has chosen to serializestd::path::Path
as astr
, if that path doesn't pass the utf-8 check, that causes the whole serialization to error. I've chosen to panic if an error happens during serialization. This PR aims to avoid that panic by checking myself if the path is valid utf-8 and, if it isn't, escape it.Fix #3