(mode: TargetMode, string_prefix: &str)
| 472 | let cwd = cwd.canonicalize()?; |
| 473 | if let Ok(relative) = canonical.strip_prefix(&cwd) { |
| 474 | (cwd, relative.to_path_buf()) |
| 475 | } else { |
| 476 | let parent = canonical.parent().ok_or_else(|| { |
| 477 | CliError::Usage(format!("`{input}` has no parent workspace directory")) |
| 478 | })?; |
| 479 | let file_name = canonical.file_name().ok_or_else(|| { |
| 480 | CliError::Usage(format!("`{input}` does not name a regular input file")) |
| 481 | })?; |
| 482 | (parent.to_path_buf(), PathBuf::from(file_name)) |
no test coverage detected