diff options
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 36 |
1 files changed, 0 insertions, 36 deletions
@@ -400,42 +400,6 @@ impl TypeTransform { } } -/// Just a convenience trait for us to avoid match/if-let blocks everywhere. -trait As<T> { - fn get_as(&self) -> Option<&T>; - fn get_as_mut(&mut self) -> Option<&mut T>; -} - -impl As<AngleBracketedGenericArguments> for PathArguments { - fn get_as(&self) -> Option<&AngleBracketedGenericArguments> { - match self { - PathArguments::AngleBracketed(args) => Some(args), - _other => None, - } - } - fn get_as_mut(&mut self) -> Option<&mut AngleBracketedGenericArguments> { - match self { - PathArguments::AngleBracketed(args) => Some(args), - _other => None, - } - } -} - -impl As<Type> for GenericArgument { - fn get_as(&self) -> Option<&Type> { - match self { - GenericArgument::Type(typearg) => Some(typearg), - _other => None, - } - } - fn get_as_mut(&mut self) -> Option<&mut Type> { - match self { - GenericArgument::Type(typearg) => Some(typearg), - _other => None, - } - } -} - fn path_segment_for_trait(sometrait: &ItemTrait) -> PathSegment { PathSegment { ident: sometrait.ident.clone(), |