Adds the given base `directory` to the `path`, if it's not already absolute.
(path: &Path, directory: &Path)
| 177 | |
| 178 | /// Adds the given base `directory` to the `path`, if it's not already absolute. |
| 179 | pub fn normalize_path(path: &Path, directory: &Path) -> PathBuf { |
| 180 | if path.is_absolute() { |
| 181 | path.to_path_buf() |
| 182 | } else { |
| 183 | [directory, path].into_iter().collect() |
| 184 | } |
| 185 | } |
| 186 | |
| 187 | #[derive(Debug, Eq, PartialEq)] |
| 188 | pub enum StringPart<'a> { |
no test coverage detected