opencv-rust
opencv-rust copied to clipboard
Accepting `std::path::Path` in `imwrite`, etc?
Currently, imwrite, imread, etc. take &str as the path argument. This is kind of annoying if you're dealing with std::path::Paths, which have to be turned into &strs. Is there a reason we can't accept AsRef<Path> there instead? This would allow callers to pass &str/String OR Path/PathBuf. Accepting this can even be done with a macro, if code aesthetics is a concern. It's also possible to do this without generics by accepting impl AsRef<Path>.