Currently, if you want to pass a Path to viuer::print_from_file, you have to convert it to a &str:
let path = Path::new("some/path/foo.png");
print_from_file(path.to_str().unwrap(), &Default::default());
This isn't very ergonomic, and if your path contains invalid UTF-8, you can't use it all. Since image::io::Reader::open already takes an AsRef<Path>, I don't see any technical reason for this limitation. Additionally, str already implements AsRef<Path>, so I don't think this would be a breaking change. I'm happy to submit a pull request implementing this change, if it's wanted.
Currently, if you want to pass a
Path
toviuer::print_from_file
, you have to convert it to a&str
:This isn't very ergonomic, and if your path contains invalid UTF-8, you can't use it all. Since
image::io::Reader::open
already takes anAsRef<Path>
, I don't see any technical reason for this limitation. Additionally,str
already implementsAsRef<Path>
, so I don't think this would be a breaking change. I'm happy to submit a pull request implementing this change, if it's wanted.