syn
syn copied to clipboard
Add method to Punctuated to remove trailing punctuation
I have a Path for an enum variant like my_mod::MyType::MyVariant, and I can remove the MyVariant part with path.segments.pop(), however that gives me a path like my_mod::MyType:: which is syntatically incorrect for a Path to a type.
Punctuated should have a method to remove the trailing ::.