Function pdfshrink::pdf_subdir [−][src]
pub fn pdf_subdir<P, Q>(inpath: P, subdir: Q) -> Option<PathBuf> where
P: AsRef<Path>,
Q: AsRef<Path>,
Returns the subdirectory subdir
sibling of inpath
.
If there is no extension, or the extension is not .pdf
, returns None
.
Examples
let before = "some dir/name.pdf"; let after = "some dir/subdir"; assert_eq!(pdf_subdir(before, "subdir"), Some(after.into()));