pub fn with_extension<P: AsRef<Path>>(path: P, new_ext: &str) -> PathBuf
Replace the extension of path with new_ext. If new_ext is empty the extension (and its leading .) is removed.
path
new_ext
.