Merge pull request #5 from jevolk/conduwuit-changes

GATs are stable
This commit is contained in:
June 🍓🦴 2024-06-25 04:38:15 -04:00 committed by GitHub
commit f502c88878
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -267,13 +267,6 @@ impl TryFrom<Field> for ResponseField {
type Error = syn::Error;
fn try_from(mut field: Field) -> syn::Result<Self> {
if has_lifetime(&field.ty) {
return Err(syn::Error::new_spanned(
field.ident,
"Lifetimes on Response fields cannot be supported until GAT are stable",
));
}
let (mut api_attrs, attrs) =
field.attrs.into_iter().partition::<Vec<_>, _>(|attr| attr.path().is_ident("ruma_api"));
field.attrs = attrs;
@ -305,6 +298,7 @@ impl ToTokens for ResponseField {
}
}
#[allow(dead_code)]
fn has_lifetime(ty: &Type) -> bool {
struct Visitor {
found_lifetime: bool,