@@ -181,33 +181,14 @@ impl<'a> Context<'a> {
181
181
. unwrap ( )
182
182
. field
183
183
. iter ( )
184
- . all ( |field| self . can_message_field_derive_copy ( fq_message_name, field) )
184
+ . all ( |field| self . can_field_derive_copy ( fq_message_name, field) )
185
185
}
186
186
187
187
/// Returns `true` if the type of this message field allows deriving the Copy trait.
188
- pub fn can_message_field_derive_copy (
188
+ pub fn can_field_derive_copy (
189
189
& self ,
190
190
fq_message_name : & str ,
191
191
field : & FieldDescriptorProto ,
192
- ) -> bool {
193
- self . can_field_derive_copy_impl ( fq_message_name, None , field)
194
- }
195
-
196
- /// Returns `true` if the type of this field in a oneof allows deriving the Copy trait.
197
- pub fn can_oneof_field_derive_copy (
198
- & self ,
199
- fq_message_name : & str ,
200
- oneof_name : & str ,
201
- field : & FieldDescriptorProto ,
202
- ) -> bool {
203
- self . can_field_derive_copy_impl ( fq_message_name, Some ( oneof_name) , field)
204
- }
205
-
206
- fn can_field_derive_copy_impl (
207
- & self ,
208
- fq_message_name : & str ,
209
- oneof : Option < & str > ,
210
- field : & FieldDescriptorProto ,
211
192
) -> bool {
212
193
assert_eq ! ( "." , & fq_message_name[ ..1 ] ) ;
213
194
@@ -222,14 +203,10 @@ impl<'a> Context<'a> {
222
203
{
223
204
return false ;
224
205
}
225
- let config_path = match oneof {
226
- None => Cow :: Borrowed ( fq_message_name) ,
227
- Some ( oneof_name) => Cow :: Owned ( format ! ( "{fq_message_name}.{oneof_name}" ) ) ,
228
- } ;
229
206
if self
230
207
. config
231
208
. boxed
232
- . get_first_field ( & config_path , field. name ( ) )
209
+ . get_first_field ( fq_message_name , field. name ( ) )
233
210
. is_some ( )
234
211
{
235
212
false
0 commit comments