@@ -110,17 +110,15 @@ impl DeriveFrom for FieldInfo {
110
110
impl DeriveFrom for Peripheral {
111
111
fn derive_from ( & self , other : & Self ) -> Self {
112
112
match ( self , other) {
113
- ( Self :: Single ( info) , Self :: Single ( other_info) ) => {
114
- Self :: Single ( info. derive_from ( other_info) )
115
- }
113
+ ( Self :: Single ( info) , Self :: Single ( other_info) ) => info. derive_from ( other_info) . single ( ) ,
116
114
( Self :: Single ( info) , Self :: Array ( other_info, other_dim) ) => {
117
115
let mut dim = other_dim. clone ( ) ;
118
116
dim. dim_name = None ;
119
- Self :: Array ( info. derive_from ( other_info) , dim)
117
+ info. derive_from ( other_info) . array ( dim)
120
118
}
121
119
( Self :: Array ( info, dim) , Self :: Single ( other_info) )
122
120
| ( Self :: Array ( info, dim) , Self :: Array ( other_info, _) ) => {
123
- Self :: Array ( info. derive_from ( other_info) , dim. clone ( ) )
121
+ info. derive_from ( other_info) . array ( dim. clone ( ) )
124
122
}
125
123
}
126
124
}
@@ -129,17 +127,15 @@ impl DeriveFrom for Peripheral {
129
127
impl DeriveFrom for Cluster {
130
128
fn derive_from ( & self , other : & Self ) -> Self {
131
129
match ( self , other) {
132
- ( Self :: Single ( info) , Self :: Single ( other_info) ) => {
133
- Self :: Single ( info. derive_from ( other_info) )
134
- }
130
+ ( Self :: Single ( info) , Self :: Single ( other_info) ) => info. derive_from ( other_info) . single ( ) ,
135
131
( Self :: Single ( info) , Self :: Array ( other_info, other_dim) ) => {
136
132
let mut dim = other_dim. clone ( ) ;
137
133
dim. dim_name = None ;
138
- Self :: Array ( info. derive_from ( other_info) , dim)
134
+ info. derive_from ( other_info) . array ( dim)
139
135
}
140
136
( Self :: Array ( info, dim) , Self :: Single ( other_info) )
141
137
| ( Self :: Array ( info, dim) , Self :: Array ( other_info, _) ) => {
142
- Self :: Array ( info. derive_from ( other_info) , dim. clone ( ) )
138
+ info. derive_from ( other_info) . array ( dim. clone ( ) )
143
139
}
144
140
}
145
141
}
@@ -148,17 +144,15 @@ impl DeriveFrom for Cluster {
148
144
impl DeriveFrom for Register {
149
145
fn derive_from ( & self , other : & Self ) -> Self {
150
146
match ( self , other) {
151
- ( Self :: Single ( info) , Self :: Single ( other_info) ) => {
152
- Self :: Single ( info. derive_from ( other_info) )
153
- }
147
+ ( Self :: Single ( info) , Self :: Single ( other_info) ) => info. derive_from ( other_info) . single ( ) ,
154
148
( Self :: Single ( info) , Self :: Array ( other_info, other_dim) ) => {
155
149
let mut dim = other_dim. clone ( ) ;
156
150
dim. dim_name = None ;
157
- Self :: Array ( info. derive_from ( other_info) , dim)
151
+ info. derive_from ( other_info) . array ( dim)
158
152
}
159
153
( Self :: Array ( info, dim) , Self :: Single ( other_info) )
160
154
| ( Self :: Array ( info, dim) , Self :: Array ( other_info, _) ) => {
161
- Self :: Array ( info. derive_from ( other_info) , dim. clone ( ) )
155
+ info. derive_from ( other_info) . array ( dim. clone ( ) )
162
156
}
163
157
}
164
158
}
@@ -167,17 +161,15 @@ impl DeriveFrom for Register {
167
161
impl DeriveFrom for Field {
168
162
fn derive_from ( & self , other : & Self ) -> Self {
169
163
match ( self , other) {
170
- ( Self :: Single ( info) , Self :: Single ( other_info) ) => {
171
- Self :: Single ( info. derive_from ( other_info) )
172
- }
164
+ ( Self :: Single ( info) , Self :: Single ( other_info) ) => info. derive_from ( other_info) . single ( ) ,
173
165
( Self :: Single ( info) , Self :: Array ( other_info, other_dim) ) => {
174
166
let mut dim = other_dim. clone ( ) ;
175
167
dim. dim_name = None ;
176
- Self :: Array ( info. derive_from ( other_info) , dim)
168
+ info. derive_from ( other_info) . array ( dim)
177
169
}
178
170
( Self :: Array ( info, dim) , Self :: Single ( other_info) )
179
171
| ( Self :: Array ( info, dim) , Self :: Array ( other_info, _) ) => {
180
- Self :: Array ( info. derive_from ( other_info) , dim. clone ( ) )
172
+ info. derive_from ( other_info) . array ( dim. clone ( ) )
181
173
}
182
174
}
183
175
}
0 commit comments