Module util

Source
Expand description

Utility functions.

Functions§

alpha_idx_to_uint_idx
This is the reverse function to uint_idx_to_alpha_idx.
get_multi_extension
Get the full extension of a path, including all extensions. For example, for “foo.tar.gz”, this function returns “tar.gz”, and not just “gz”, like path.extension() would.
get_multi_extension_from_filename
search_upward
This function searches upward from start for directories or files matching item. It returns a Vec<PathBuf> to all found instances in order of closest to furthest away. The function only searches up within subdirectories of end.
uint_idx_to_alpha_idx
This function takes a number and converts it’s digits into the range a-p. This is nice because it makes for some easily typed ids. The function first formats the number as a hex digit and then performs the mapping.