The shared `new ns.Foo ()` normalization: strip `<...` from the first `<` (index > 0), keep the segment after the last `.`/`::`, strip ONE leading `:` or `.`, trim. Backslashes are NOT handled — php qualified names pass through whole.
(raw: &str)
| 1508 | /// leading `:` or `.`, trim. Backslashes are NOT handled — php qualified |
| 1509 | /// names pass through whole. |
| 1510 | fn strip_generic_and_qualifier(raw: &str) -> String { |
| 1511 | let mut name = raw.to_string(); |
| 1512 | if let Some(lt) = name.find('<') { |
| 1513 | if lt > 0 { |
| 1514 | name.truncate(lt); |
| 1515 | } |
| 1516 | } |
| 1517 | let last_dot = name |
| 1518 | .rfind('.') |
| 1519 | .map(|i| i as isize) |
| 1520 | .unwrap_or(-1) |
| 1521 | .max(name.rfind("::").map(|i| i as isize).unwrap_or(-1)); |
| 1522 | if last_dot >= 0 { |
| 1523 | name = name[(last_dot as usize + 1)..].to_string(); |
| 1524 | if name.starts_with(':') || name.starts_with('.') { |
| 1525 | name.remove(0); |
| 1526 | } |
| 1527 | } |
| 1528 | name.trim().to_string() |
| 1529 | } |
| 1530 | |
| 1531 | fn opt_str(arena: &mut Arena, s: Option<&str>) -> StrRef { |
| 1532 | match s { |
no outgoing calls
no test coverage detected