(p: &Path)
| 106 | } |
| 107 | |
| 108 | fn canonicalize_path(p: &Path) -> Result<PathBuf> { |
| 109 | let p = if p.to_str().unwrap().starts_with("~/") { |
| 110 | home()?.join(p.strip_prefix("~/").unwrap()) |
| 111 | } else { |
| 112 | p.to_path_buf() |
| 113 | }; |
| 114 | |
| 115 | p.canonicalize().context("path does not exist") |
| 116 | } |
| 117 | |
| 118 | #[test] |
| 119 | fn should_canonicalize() { |
no test coverage detected