jRimbault / yadf

Yet Another Dupes Finder
MIT License
55 stars 0 forks source link

fix: avoid panic during invalid UTF-8 Path serialization #4

Closed jRimbault closed 3 years ago

jRimbault commented 3 years ago

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.

Fix #3