diff options
author | Martin Fischer <martin@push-f.com> | 2021-11-20 12:29:15 +0100 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2021-11-20 12:29:28 +0100 |
commit | e918eb0ab2cf6d84751f5f52b49414d382b7abbb (patch) | |
tree | 0838bf246c8b8676985ecbdc6255b21fe619e12a /src/lib.rs | |
parent | 7d549f29d63df264884e80f1e95d881d7c0f7407 (diff) |
refactor: remove now pointless internal trait
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(), |