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)
| 1496 | /// leading `:` or `.`, trim. Backslashes are NOT handled — php qualified |
| 1497 | /// names pass through whole. |
| 1498 | fn strip_generic_and_qualifier(raw: &str) -> String { |
| 1499 | let mut name = raw.to_string(); |
| 1500 | if let Some(lt) = name.find('<') { |
| 1501 | if lt > 0 { |
| 1502 | name.truncate(lt); |
| 1503 | } |
| 1504 | } |
| 1505 | let last_dot = name |
| 1506 | .rfind('.') |
| 1507 | .map(|i| i as isize) |
| 1508 | .unwrap_or(-1) |
| 1509 | .max(name.rfind("::").map(|i| i as isize).unwrap_or(-1)); |
| 1510 | if last_dot >= 0 { |
| 1511 | name = name[(last_dot as usize + 1)..].to_string(); |
| 1512 | if name.starts_with(':') || name.starts_with('.') { |
| 1513 | name.remove(0); |
| 1514 | } |
| 1515 | } |
| 1516 | name.trim().to_string() |
| 1517 | } |
| 1518 | |
| 1519 | fn opt_str(arena: &mut Arena, s: Option<&str>) -> StrRef { |
| 1520 | match s { |
no outgoing calls
no test coverage detected