The shared decorator-name normalization: strip `<...` from the first `<` (index > 0), keep the segment after the last `.`/`::`, strip ONE leading `:` or `.`, trim.
(raw: &str)
| 1686 | /// (index > 0), keep the segment after the last `.`/`::`, strip ONE leading |
| 1687 | /// `:` or `.`, trim. |
| 1688 | fn strip_generic_and_qualifier(raw: &str) -> String { |
| 1689 | let mut name = raw.to_string(); |
| 1690 | if let Some(lt) = name.find('<') { |
| 1691 | if lt > 0 { |
| 1692 | name.truncate(lt); |
| 1693 | } |
| 1694 | } |
| 1695 | let last_dot = name |
| 1696 | .rfind('.') |
| 1697 | .map(|i| i as isize) |
| 1698 | .unwrap_or(-1) |
| 1699 | .max(name.rfind("::").map(|i| i as isize).unwrap_or(-1)); |
| 1700 | if last_dot >= 0 { |
| 1701 | name = name[(last_dot as usize + 1)..].to_string(); |
| 1702 | if name.starts_with(':') || name.starts_with('.') { |
| 1703 | name.remove(0); |
| 1704 | } |
| 1705 | } |
| 1706 | name.trim().to_string() |
| 1707 | } |
| 1708 | |
| 1709 | fn opt_str(arena: &mut Arena, s: Option<&str>) -> StrRef { |
| 1710 | match s { |