Function rustdoc::html::sources::clean_path
source · pub(crate) fn clean_path<F>(src_root: &Path, p: &Path, keep_filename: bool, f: F)where
F: FnMut(&OsStr),Expand description
Takes a path to a source file and cleans the path to it. This canonicalizes
things like “..” to components which preserve the “top down” hierarchy of a
static HTML tree. Each component in the cleaned path will be passed as an
argument to f. The very last component of the path (ie the file name) will
be passed to f if keep_filename is true, and ignored otherwise.