It is possible to create an empty PathBuf:
— yet PathBuf has no is_empty() function (nor, apparently, do Path or OsStr or OsString).
This seems inconsistent.
Of course, there are several ways around this (p == PathBuf::new(), p.to_str().map_or(true, |s| s.is_empty()), wrapping with Option), but having a simple way to check this would be nice.
It is possible to create an empty
PathBuf:— yet
PathBufhas nois_empty()function (nor, apparently, doPathorOsStrorOsString).This seems inconsistent.
Of course, there are several ways around this (
p == PathBuf::new(),p.to_str().map_or(true, |s| s.is_empty()), wrapping withOption), but having a simple way to check this would be nice.