1 //! A set of utils methods to reuse on other abstraction levels
3 use itertools::Itertools;
5 use crate::{ast, match_ast, AstNode};
7 pub fn path_to_string_stripping_turbo_fish(path: &ast::Path) -> String {
13 ast::PathSegment(it) => {
14 Some(it.name_ref()?.to_string())
17 Some(path_to_string_stripping_turbo_fish(&it))
28 use super::path_to_string_stripping_turbo_fish;
32 fn turbofishes_are_stripped() {
33 assert_eq!("Vec", path_to_string_stripping_turbo_fish(&make::path_from_text("Vec::<i32>")),);
36 path_to_string_stripping_turbo_fish(&make::path_from_text("Vec::<i32>::new")),
40 path_to_string_stripping_turbo_fish(&make::path_from_text("Vec::new()")),