#Remove generic arguments from `Path`
1 messages · Page 1 of 1 (latest)
With mutation:
path.segments.last_mut().unwrap().arguments = <_>::default();
// or
mem::take(path.segments.last_mut().unwrap().arguments);
and then just use path.
Without mutation:
Either .clone() so as to allow mutation;
Or:
let Path { leading_colon, segments } = &path;
let each_ident = segments.iter().map(|it| &it.ident);
quote!(
#leading_colon #( #each_ident )::*
)
if you don't mind losing the span of the intermediary ::