cairo_lang_semantic::items::us

Function get_use_path_segments

Source
pub fn get_use_path_segments(
    db: &dyn SyntaxGroup,
    use_path: UsePath,
) -> Maybe<Vec<PathSegment>>
Expand description

Returns the segments that are the parts of the use path.

The segments are returned in the order they appear in the use path. Only UsePathLeaf and UsePathSingle are supported.

For example: Given the c of use a::b::{c, d}; will return [a, b, c]. Given the b of use a::b::{c, d}; will return [a, b].