Extract the inner generic arguments from a type name while ignoring path qualifiers. e.g., both `Vec ` and `::std::vec::Vec ` return `T` when `outer` is `Vec`.
(s: &'a str, outer: &str)
| 210 | /// |
| 211 | /// e.g., both `Vec<T>` and `::std::vec::Vec<T>` return `T` when `outer` is `Vec`. |
| 212 | fn extract_generic_inner<'a>(s: &'a str, outer: &str) -> Option<&'a str> { |
| 213 | let generic_start = s.find('<')?; |
| 214 | let owner = s[..generic_start] |
| 215 | .rsplit("::") |
| 216 | .next() |
| 217 | .unwrap_or(&s[..generic_start]); |
| 218 | if owner != outer { |
| 219 | return None; |
| 220 | } |
| 221 | s[generic_start + 1..].strip_suffix('>') |
| 222 | } |
| 223 | |
| 224 | /// Return the final path segment so absolute generated paths match the same runtime type names. |
| 225 | /// |
no test coverage detected