-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Make some of the ast_util functions into methods #30058
Copy link
Copy link
Closed
Labels
E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.
Description
https://github.com/rust-lang/rust/blob/master/src/libsyntax/ast_util.rs
Things like
pub fn stmt_id(s: &Stmt) -> Option<NodeId>
should instead be
impl Stmt {
pub fn id(s: &Stmt) -> Option<NodeId> {..}
}
The same goes for many other functions that take their first argument as an AST type (BinOp, Stmt, IntTy, Path, Ident, etc. Similarly, functions like these could be Generics::empty() instead.
(Feel free to keep it in the same file or move it to ast.rs)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.