rustfmt icon indicating copy to clipboard operation
rustfmt copied to clipboard

Impl rewrite_result for ast nodes in items.rs

Open ding-young opened this issue 1 year ago • 2 comments

Tracked by #6206

Description

  • added RewriteError and blanket implementation for rewrite_result
  • above 6 ast nodes that implements rewrite, replaced rewrite function body with rewrite_result for 4 nodes; ast::Local, ast::FieldDef, ast::Param, ast::FnRetTy

ding-young avatar Jun 24 '24 05:06 ding-young

@ytmimi Thank you for your review. It seems like I missed some details. I'll take a more careful look at the next PR. I am wondering to what extent I should modify functions like rewrite_*** in this PR. For example, you recommended modifying rewrite_let_else_block and rewrite_explicit_self, while you suggested changing the signature of combine_str_with_missing_comment later. Should I proceed with modifying the simpler ones for now?

ding-young avatar Jun 25 '24 01:06 ding-young

I'm fairly certain that rewrite_let_else_block and rewrite_explicit_self are only used within these functions so it's likely easier to update their signatures now, while combine_str_with_missing_comment is used throughout the codebase and would require touching a lot of different files.

If you feel like it would be a lot to extend the scope of the current PR then we can always revisit modifying all of these functions in future PRs, but if it's not a heavy lift then we might want to consider doing some of that work in this PR.

ytmimi avatar Jun 25 '24 02:06 ytmimi

@ding-young when you have a chance can you squash the commits and rebase this PR to bring it up to date

ytmimi avatar Jul 03 '24 23:07 ytmimi