File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed
Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -1036,6 +1036,16 @@ impl IdentFragment for Member {
10361036 }
10371037}
10381038
1039+ #[ cfg( any( feature = "parsing" , feature = "printing" ) ) ]
1040+ impl Member {
1041+ pub ( crate ) fn is_named ( & self ) -> bool {
1042+ match self {
1043+ Member :: Named ( _) => true ,
1044+ Member :: Unnamed ( _) => false ,
1045+ }
1046+ }
1047+ }
1048+
10391049ast_struct ! {
10401050 /// The index of an unnamed tuple struct field.
10411051 #[ cfg_attr( docsrs, doc( cfg( any( feature = "full" , feature = "derive" ) ) ) ) ]
@@ -3021,15 +3031,6 @@ pub(crate) mod parsing {
30213031 Ok ( !trailing_dot)
30223032 }
30233033
3024- impl Member {
3025- pub ( crate ) fn is_named ( & self ) -> bool {
3026- match self {
3027- Member :: Named ( _) => true ,
3028- Member :: Unnamed ( _) => false ,
3029- }
3030- }
3031- }
3032-
30333034 #[ cfg( feature = "full" ) ]
30343035 #[ cfg_attr( docsrs, doc( cfg( feature = "parsing" ) ) ) ]
30353036 impl Parse for PointerMutability {
@@ -3410,8 +3411,8 @@ pub(crate) mod printing {
34103411 true ,
34113412 false ,
34123413 ) ;
3413- let needs_group = if let Expr :: Field ( _ ) = & * e. func {
3414- true
3414+ let needs_group = if let Expr :: Field ( func ) = & * e. func {
3415+ func . member . is_named ( )
34153416 } else {
34163417 func_fixup. leading_precedence ( & e. func ) < Precedence :: Unambiguous
34173418 } ;
You can’t perform that action at this time.
0 commit comments