Returns the directory containing the config file.
(&self)
| 64 | |
| 65 | /// Returns the directory containing the config file. |
| 66 | pub fn config_dir(&self) -> Option<PathBuf> { |
| 67 | let canonical_path = self |
| 68 | .path |
| 69 | .canonicalize() |
| 70 | .unwrap_or_else(|_| self.path.clone()); |
| 71 | canonical_path.parent().map(|p| p.to_path_buf()) |
| 72 | } |
| 73 | |
| 74 | /// Get list of directories to search for config files |
| 75 | /// |