You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to write future-proof code that asserts matches!(field.mutability, FieldMutability::None) and reports a nice error if it isn't None:
letField{ mutability, .. } = &mut field;if !matches!(mutability, FieldMutability::None){
errors.push(syn::Error::new_spanned(mutability,"field mutability is not supported"));*mutability = FieldMutability::None;}
but that doesn't work because FieldMutability doesn't implement ToTokens.
Please add a ToTokens implementation. Adding a Parse implementation while you're at it would be nice.
The text was updated successfully, but these errors were encountered:
I'm trying to write future-proof code that asserts
matches!(field.mutability, FieldMutability::None)
and reports a nice error if it isn'tNone
:but that doesn't work because
FieldMutability
doesn't implementToTokens
.Please add a
ToTokens
implementation. Adding aParse
implementation while you're at it would be nice.The text was updated successfully, but these errors were encountered: