Normalise a PSR-4 namespace prefix: ensure it ends with `\` unless it is the empty root-namespace prefix.
(prefix: &str)
| 350 | /// Normalise a PSR-4 namespace prefix: ensure it ends with `\` unless |
| 351 | /// it is the empty root-namespace prefix. |
| 352 | fn normalise_prefix(prefix: &str) -> String { |
| 353 | if prefix.ends_with('\\') { |
| 354 | prefix.to_string() |
| 355 | } else if prefix.is_empty() { |
| 356 | // Empty prefix means "fallback" / root namespace |
| 357 | String::new() |
| 358 | } else { |
| 359 | format!("{}\\", prefix) |
| 360 | } |
| 361 | } |
| 362 | |
| 363 | /// Collect PSR-4 entries from any value that implements [`Psr4Paths`]. |
| 364 | fn collect_psr4_entries<P: Psr4Paths>(prefix: &str, paths: &P, mappings: &mut Vec<Psr4Mapping>) { |
no test coverage detected