Resolve `.` and `..` components lexically, without touching the filesystem.
(path: &Path)
| 1354 | if !found && part == "programs" { |
| 1355 | found = true; |
| 1356 | } |
| 1357 | if found { |
| 1358 | parts.push(part.to_string_lossy().into_owned()); |
| 1359 | } |
| 1360 | } |
| 1361 | } |
| 1362 | found.then(|| parts.join("/")) |
| 1363 | } |
| 1364 | |
| 1365 | fn sanitize_artifact_component(value: &str) -> String { |
| 1366 | let mut out = String::with_capacity(value.len()); |
| 1367 | for ch in value.chars() { |
| 1368 | if ch.is_ascii_alphanumeric() || matches!(ch, '_' | '-' | '.') { |
| 1369 | out.push(ch); |
| 1370 | } else { |
| 1371 | out.push('_'); |
| 1372 | } |
| 1373 | } |
no test coverage detected