clippy_utils::hir_utils

Function generic_path_segments

Source
fn generic_path_segments<'tcx>(
    segments: &'tcx [PathSegment<'tcx>],
) -> Option<&'tcx [PathSegment<'tcx>]>
Expand description

Returns the segments of a path that might have generic parameters. Usually just the last segment for free items, except for when the path resolves to an associated item, in which case it is the last two