@@ -63,28 +63,30 @@ impl<I: Interner, V: Eq> Eq for Canonical<I, V> {}
63
63
64
64
impl < I : Interner , V : PartialEq > PartialEq for Canonical < I , V > {
65
65
fn eq ( & self , other : & Self ) -> bool {
66
- self . value == other. value
67
- && self . max_universe == other. max_universe
68
- && self . variables == other. variables
66
+ let Self { value, max_universe, variables } = self ;
67
+ * value == other. value
68
+ && * max_universe == other. max_universe
69
+ && * variables == other. variables
69
70
}
70
71
}
71
72
72
73
impl < I : Interner , V : fmt:: Display > fmt:: Display for Canonical < I , V > {
73
74
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
75
+ let Self { value, max_universe, variables } = self ;
74
76
write ! (
75
77
f,
76
- "Canonical {{ value: {}, max_universe: {:?}, variables: {:?} }}" ,
77
- self . value, self . max_universe, self . variables
78
+ "Canonical {{ value: {value}, max_universe: {max_universe:?}, variables: {variables:?} }}" ,
78
79
)
79
80
}
80
81
}
81
82
82
83
impl < I : Interner , V : fmt:: Debug > fmt:: Debug for Canonical < I , V > {
83
84
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
85
+ let Self { value, max_universe, variables } = self ;
84
86
f. debug_struct ( "Canonical" )
85
- . field ( "value" , & self . value )
86
- . field ( "max_universe" , & self . max_universe )
87
- . field ( "variables" , & self . variables )
87
+ . field ( "value" , & value)
88
+ . field ( "max_universe" , & max_universe)
89
+ . field ( "variables" , & variables)
88
90
. finish ( )
89
91
}
90
92
}
@@ -109,9 +111,10 @@ where
109
111
I :: CanonicalVars : TypeVisitable < I > ,
110
112
{
111
113
fn visit_with < F : TypeVisitor < I > > ( & self , folder : & mut F ) -> F :: Result {
112
- try_visit ! ( self . value. visit_with( folder) ) ;
113
- try_visit ! ( self . max_universe. visit_with( folder) ) ;
114
- self . variables . visit_with ( folder)
114
+ let Self { value, max_universe, variables } = self ;
115
+ try_visit ! ( value. visit_with( folder) ) ;
116
+ try_visit ! ( max_universe. visit_with( folder) ) ;
117
+ variables. visit_with ( folder)
115
118
}
116
119
}
117
120
0 commit comments