-
-
Notifications
You must be signed in to change notification settings - Fork 315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add Fold
/VisitMut
methods for Vec<T>
, Option<T>
, Punctuated
, etc.
#1599
Comments
as mentioned above, this is also a problem for |
Vec<Stmt> is exclusively present in Block so it can easily be handled in fold_block already. |
that takes care of |
What use case did you have for a method dedicated to those? |
well, for fields I've written proc macros that transform type definitions by removing fields that have a #[my_io]
struct S {
#[my_io(in)]
a: u32,
#[my_io(out)]
b: i16,
} would covert to something like struct S {
a: Input<u32>,
b: Output<i16>,
} |
I'm trying to build a
Fold
visitor that removes allAttribute
s that match a pattern, usingFold::fold_attribute
doesn't work because I want to replace the attribute with nothing, not another attribute.I think adding
Fold::fold_attributes
is a good solution.I also ran into this problem when trying to transform
Stmt
into nothing, I had to construct a no-opStmt
.The text was updated successfully, but these errors were encountered: