The shared decorator-name normalization: strip `<...` from the first `<` (index > 0), keep the segment after the last `.`/`::`, strip ONE leading `:` or `.`, trim.
(raw: &str)
| 1575 | /// (index > 0), keep the segment after the last `.`/`::`, strip ONE leading |
| 1576 | /// `:` or `.`, trim. |
| 1577 | fn strip_generic_and_qualifier(raw: &str) -> String { |
| 1578 | let mut name = raw.to_string(); |
| 1579 | if let Some(lt) = name.find('<') { |
| 1580 | if lt > 0 { |
| 1581 | name.truncate(lt); |
| 1582 | } |
| 1583 | } |
| 1584 | let last_dot = name |
| 1585 | .rfind('.') |
| 1586 | .map(|i| i as isize) |
| 1587 | .unwrap_or(-1) |
| 1588 | .max(name.rfind("::").map(|i| i as isize).unwrap_or(-1)); |
| 1589 | if last_dot >= 0 { |
| 1590 | name = name[(last_dot as usize + 1)..].to_string(); |
| 1591 | if name.starts_with(':') || name.starts_with('.') { |
| 1592 | name.remove(0); |
| 1593 | } |
| 1594 | } |
| 1595 | name.trim().to_string() |
| 1596 | } |
| 1597 | |
| 1598 | fn opt_str(arena: &mut Arena, s: Option<&str>) -> StrRef { |
| 1599 | match s { |