Rollup merge of #133746 - oli-obk:push-xwyrylxmrtvq, r=jieyouxu
Change `AttrArgs::Eq` to a struct variant Cleanups for simplifying https://github.com/rust-lang/rust/pull/131808 Basically changes `AttrArgs::Eq` to a struct variant and then avoids several matches on `AttrArgsEq` in favor of methods on it. This will make future refactorings simpler, as they can either keep methods or switch to field accesses without having to restructure code
This commit is contained in:
commit
6f9f17fc08
16 changed files with 68 additions and 52 deletions
|
@ -648,14 +648,14 @@ pub trait PrintState<'a>: std::ops::Deref<Target = pp::Printer> + std::ops::Dere
|
|||
AttrArgs::Empty => {
|
||||
self.print_path(&item.path, false, 0);
|
||||
}
|
||||
AttrArgs::Eq(_, AttrArgsEq::Ast(expr)) => {
|
||||
AttrArgs::Eq { value: AttrArgsEq::Ast(expr), .. } => {
|
||||
self.print_path(&item.path, false, 0);
|
||||
self.space();
|
||||
self.word_space("=");
|
||||
let token_str = self.expr_to_string(expr);
|
||||
self.word(token_str);
|
||||
}
|
||||
AttrArgs::Eq(_, AttrArgsEq::Hir(lit)) => {
|
||||
AttrArgs::Eq { value: AttrArgsEq::Hir(lit), .. } => {
|
||||
self.print_path(&item.path, false, 0);
|
||||
self.space();
|
||||
self.word_space("=");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue