The shared decorator-name normalization: strip `<...` from the first `<` (index > 0), keep the segment after the last `.`/`::`, strip ONE leading `:` or `.`, trim.
(raw: &str)
| 1590 | /// (index > 0), keep the segment after the last `.`/`::`, strip ONE leading |
| 1591 | /// `:` or `.`, trim. |
| 1592 | fn strip_generic_and_qualifier(raw: &str) -> String { |
| 1593 | let mut name = raw.to_string(); |
| 1594 | if let Some(lt) = name.find('<') { |
| 1595 | if lt > 0 { |
| 1596 | name.truncate(lt); |
| 1597 | } |
| 1598 | } |
| 1599 | let last_dot = name |
| 1600 | .rfind('.') |
| 1601 | .map(|i| i as isize) |
| 1602 | .unwrap_or(-1) |
| 1603 | .max(name.rfind("::").map(|i| i as isize).unwrap_or(-1)); |
| 1604 | if last_dot >= 0 { |
| 1605 | name = name[(last_dot as usize + 1)..].to_string(); |
| 1606 | if name.starts_with(':') || name.starts_with('.') { |
| 1607 | name.remove(0); |
| 1608 | } |
| 1609 | } |
| 1610 | name.trim().to_string() |
| 1611 | } |
| 1612 | |
| 1613 | fn opt_str(arena: &mut Arena, s: Option<&str>) -> StrRef { |
| 1614 | match s { |