The shared decorator-name normalization: strip `<...` from the first `<` (index > 0), keep the segment after the last `.`/`::`, strip ONE leading `:` or `.`, trim.
(raw: &str)
| 1631 | /// (index > 0), keep the segment after the last `.`/`::`, strip ONE leading |
| 1632 | /// `:` or `.`, trim. |
| 1633 | fn strip_generic_and_qualifier(raw: &str) -> String { |
| 1634 | let mut name = raw.to_string(); |
| 1635 | if let Some(lt) = name.find('<') { |
| 1636 | if lt > 0 { |
| 1637 | name.truncate(lt); |
| 1638 | } |
| 1639 | } |
| 1640 | let last_dot = name |
| 1641 | .rfind('.') |
| 1642 | .map(|i| i as isize) |
| 1643 | .unwrap_or(-1) |
| 1644 | .max(name.rfind("::").map(|i| i as isize).unwrap_or(-1)); |
| 1645 | if last_dot >= 0 { |
| 1646 | name = name[(last_dot as usize + 1)..].to_string(); |
| 1647 | if name.starts_with(':') || name.starts_with('.') { |
| 1648 | name.remove(0); |
| 1649 | } |
| 1650 | } |
| 1651 | name.trim().to_string() |
| 1652 | } |
| 1653 | |
| 1654 | fn opt_str(arena: &mut Arena, s: Option<&str>) -> StrRef { |
| 1655 | match s { |