@@ -265,7 +265,6 @@ pub struct State<'input> {
265
265
pub trait_name : & ' static str ,
266
266
pub trait_ident : Ident ,
267
267
pub method_ident : Ident ,
268
- pub trait_module : TokenStream ,
269
268
pub trait_path : TokenStream ,
270
269
pub trait_path_params : Vec < TokenStream > ,
271
270
pub trait_attr : String ,
@@ -314,13 +313,11 @@ impl<'input> State<'input> {
314
313
pub fn new < ' arg_input > (
315
314
input : & ' arg_input DeriveInput ,
316
315
trait_name : & ' static str ,
317
- trait_module : TokenStream ,
318
316
trait_attr : String ,
319
317
) -> Result < State < ' arg_input > > {
320
318
State :: new_impl (
321
319
input,
322
320
trait_name,
323
- trait_module,
324
321
trait_attr,
325
322
AttrParams :: default ( ) ,
326
323
true ,
@@ -330,13 +327,11 @@ impl<'input> State<'input> {
330
327
pub fn with_field_ignore < ' arg_input > (
331
328
input : & ' arg_input DeriveInput ,
332
329
trait_name : & ' static str ,
333
- trait_module : TokenStream ,
334
330
trait_attr : String ,
335
331
) -> Result < State < ' arg_input > > {
336
332
State :: new_impl (
337
333
input,
338
334
trait_name,
339
- trait_module,
340
335
trait_attr,
341
336
AttrParams :: new ( vec ! [ "ignore" ] ) ,
342
337
true ,
@@ -346,13 +341,11 @@ impl<'input> State<'input> {
346
341
pub fn with_field_ignore_and_forward < ' arg_input > (
347
342
input : & ' arg_input DeriveInput ,
348
343
trait_name : & ' static str ,
349
- trait_module : TokenStream ,
350
344
trait_attr : String ,
351
345
) -> Result < State < ' arg_input > > {
352
346
State :: new_impl (
353
347
input,
354
348
trait_name,
355
- trait_module,
356
349
trait_attr,
357
350
AttrParams :: new ( vec ! [ "ignore" , "forward" ] ) ,
358
351
true ,
@@ -362,13 +355,11 @@ impl<'input> State<'input> {
362
355
pub fn with_field_ignore_and_refs < ' arg_input > (
363
356
input : & ' arg_input DeriveInput ,
364
357
trait_name : & ' static str ,
365
- trait_module : TokenStream ,
366
358
trait_attr : String ,
367
359
) -> Result < State < ' arg_input > > {
368
360
State :: new_impl (
369
361
input,
370
362
trait_name,
371
- trait_module,
372
363
trait_attr,
373
364
AttrParams :: new ( vec ! [ "ignore" , "owned" , "ref" , "ref_mut" ] ) ,
374
365
true ,
@@ -378,14 +369,12 @@ impl<'input> State<'input> {
378
369
pub fn with_attr_params < ' arg_input > (
379
370
input : & ' arg_input DeriveInput ,
380
371
trait_name : & ' static str ,
381
- trait_module : TokenStream ,
382
372
trait_attr : String ,
383
373
allowed_attr_params : AttrParams ,
384
374
) -> Result < State < ' arg_input > > {
385
375
State :: new_impl (
386
376
input,
387
377
trait_name,
388
- trait_module,
389
378
trait_attr,
390
379
allowed_attr_params,
391
380
true ,
@@ -395,15 +384,13 @@ impl<'input> State<'input> {
395
384
pub fn with_type_bound < ' arg_input > (
396
385
input : & ' arg_input DeriveInput ,
397
386
trait_name : & ' static str ,
398
- trait_module : TokenStream ,
399
387
trait_attr : String ,
400
388
allowed_attr_params : AttrParams ,
401
389
add_type_bound : bool ,
402
390
) -> Result < State < ' arg_input > > {
403
391
Self :: new_impl (
404
392
input,
405
393
trait_name,
406
- trait_module,
407
394
trait_attr,
408
395
allowed_attr_params,
409
396
add_type_bound,
@@ -413,15 +400,14 @@ impl<'input> State<'input> {
413
400
fn new_impl < ' arg_input > (
414
401
input : & ' arg_input DeriveInput ,
415
402
trait_name : & ' static str ,
416
- trait_module : TokenStream ,
417
403
trait_attr : String ,
418
404
allowed_attr_params : AttrParams ,
419
405
add_type_bound : bool ,
420
406
) -> Result < State < ' arg_input > > {
421
407
let trait_name = trait_name. trim_end_matches ( "ToInner" ) ;
422
408
let trait_ident = format_ident ! ( "{trait_name}" ) ;
423
409
let method_ident = format_ident ! ( "{trait_attr}" ) ;
424
- let trait_path = quote ! { #trait_module :: #trait_ident } ;
410
+ let trait_path = quote ! { :: derive_more :: #trait_ident } ;
425
411
let ( derive_type, fields, variants) : ( _ , Vec < _ > , Vec < _ > ) = match input. data {
426
412
Data :: Struct ( ref data_struct) => match data_struct. fields {
427
413
Fields :: Unnamed ( ref fields) => {
@@ -516,7 +502,6 @@ impl<'input> State<'input> {
516
502
State :: from_variant (
517
503
input,
518
504
trait_name,
519
- trait_module. clone ( ) ,
520
505
trait_attr. clone ( ) ,
521
506
allowed_attr_params. clone ( ) ,
522
507
variant,
@@ -539,7 +524,6 @@ impl<'input> State<'input> {
539
524
trait_name,
540
525
trait_ident,
541
526
method_ident,
542
- trait_module,
543
527
trait_path,
544
528
trait_path_params : vec ! [ ] ,
545
529
trait_attr,
@@ -558,7 +542,6 @@ impl<'input> State<'input> {
558
542
pub fn from_variant < ' arg_input > (
559
543
input : & ' arg_input DeriveInput ,
560
544
trait_name : & ' static str ,
561
- trait_module : TokenStream ,
562
545
trait_attr : String ,
563
546
allowed_attr_params : AttrParams ,
564
547
variant : & ' arg_input Variant ,
@@ -567,7 +550,7 @@ impl<'input> State<'input> {
567
550
let trait_name = trait_name. trim_end_matches ( "ToInner" ) ;
568
551
let trait_ident = format_ident ! ( "{trait_name}" ) ;
569
552
let method_ident = format_ident ! ( "{trait_attr}" ) ;
570
- let trait_path = quote ! { #trait_module :: #trait_ident } ;
553
+ let trait_path = quote ! { :: derive_more :: #trait_ident } ;
571
554
let ( derive_type, fields) : ( _ , Vec < _ > ) = match variant. fields {
572
555
Fields :: Unnamed ( ref fields) => {
573
556
( DeriveType :: Unnamed , unnamed_to_vec ( fields) )
@@ -593,7 +576,6 @@ impl<'input> State<'input> {
593
576
Ok ( State {
594
577
input,
595
578
trait_name,
596
- trait_module,
597
579
trait_path,
598
580
trait_path_params : vec ! [ ] ,
599
581
trait_attr,
0 commit comments