@@ -269,11 +269,12 @@ impl<REG: RegisterSpec> R<REG> {
269
269
impl < REG : RegisterSpec , FI > PartialEq < FI > for R < REG >
270
270
where
271
271
REG :: Ux : PartialEq ,
272
- FI : Copy + Into < REG :: Ux > ,
272
+ FI : Copy ,
273
+ REG :: Ux : From < FI >
273
274
{
274
275
#[ inline( always) ]
275
276
fn eq ( & self , other : & FI ) -> bool {
276
- self . bits . eq ( & ( * other) . into ( ) )
277
+ self . bits . eq ( & REG :: Ux :: from ( * other) )
277
278
}
278
279
}
279
280
@@ -360,21 +361,23 @@ where
360
361
impl < U , FI > PartialEq < FI > for FieldReader < U , FI >
361
362
where
362
363
U : PartialEq ,
363
- FI : Copy + Into < U > ,
364
+ FI : Copy ,
365
+ U : From < FI > ,
364
366
{
365
367
#[ inline( always) ]
366
368
fn eq ( & self , other : & FI ) -> bool {
367
- self . bits . eq ( & ( * other) . into ( ) )
369
+ self . bits . eq ( & U :: from ( * other) )
368
370
}
369
371
}
370
372
371
373
impl < FI > PartialEq < FI > for BitReader < FI >
372
374
where
373
- FI : Copy + Into < bool > ,
375
+ FI : Copy ,
376
+ bool : From < FI > ,
374
377
{
375
378
#[ inline( always) ]
376
379
fn eq ( & self , other : & FI ) -> bool {
377
- self . bits . eq ( & ( * other) . into ( ) )
380
+ self . bits . eq ( & bool :: from ( * other) )
378
381
}
379
382
}
380
383
@@ -405,7 +408,7 @@ pub struct Unsafe;
405
408
pub struct FieldWriterRaw < ' a , U , REG , N , FI , Safety , const WI : u8 , const O : u8 >
406
409
where
407
410
REG : Writable + RegisterSpec < Ux = U > ,
408
- FI : Into < N > ,
411
+ N : From < FI > ,
409
412
{
410
413
pub ( crate ) w : & ' a mut REG :: Writer ,
411
414
_field : marker:: PhantomData < ( N , FI , Safety ) > ,
@@ -415,7 +418,7 @@ impl<'a, U, REG, N, FI, Safety, const WI: u8, const O: u8>
415
418
FieldWriterRaw < ' a , U , REG , N , FI , Safety , WI , O >
416
419
where
417
420
REG : Writable + RegisterSpec < Ux = U > ,
418
- FI : Into < N > ,
421
+ N : From < FI > ,
419
422
{
420
423
/// Creates a new instance of the writer
421
424
#[ allow( unused) ]
@@ -432,7 +435,7 @@ where
432
435
pub struct BitWriterRaw < ' a , U , REG , FI , M , const O : u8 >
433
436
where
434
437
REG : Writable + RegisterSpec < Ux = U > ,
435
- FI : Into < bool > ,
438
+ bool : From < FI > ,
436
439
{
437
440
pub ( crate ) w : & ' a mut REG :: Writer ,
438
441
_field : marker:: PhantomData < ( FI , M ) > ,
@@ -441,7 +444,7 @@ where
441
444
impl < ' a , U , REG , FI , M , const O : u8 > BitWriterRaw < ' a , U , REG , FI , M , O >
442
445
where
443
446
REG : Writable + RegisterSpec < Ux = U > ,
444
- FI : Into < bool > ,
447
+ bool : From < FI > ,
445
448
{
446
449
/// Creates a new instance of the writer
447
450
#[ allow( unused) ]
@@ -464,7 +467,7 @@ pub type FieldWriterSafe<'a, U, REG, N, FI, const WI: u8, const O: u8> =
464
467
impl < ' a , U , REG , N , FI , const WI : u8 , const OF : u8 > FieldWriter < ' a , U , REG , N , FI , WI , OF >
465
468
where
466
469
REG : Writable + RegisterSpec < Ux = U > ,
467
- FI : Into < N > ,
470
+ N : From < FI > ,
468
471
{
469
472
/// Field width
470
473
pub const WIDTH : u8 = WI ;
@@ -473,7 +476,7 @@ where
473
476
impl < ' a , U , REG , N , FI , const WI : u8 , const OF : u8 > FieldWriterSafe < ' a , U , REG , N , FI , WI , OF >
474
477
where
475
478
REG : Writable + RegisterSpec < Ux = U > ,
476
- FI : Into < N > ,
479
+ N : From < FI > ,
477
480
{
478
481
/// Field width
479
482
pub const WIDTH : u8 = WI ;
@@ -490,7 +493,7 @@ macro_rules! bit_proxy {
490
493
impl <' a, U , REG , FI , const OF : u8 > $writer<' a, U , REG , FI , OF >
491
494
where
492
495
REG : Writable + RegisterSpec <Ux = U >,
493
- FI : Into < bool >,
496
+ bool : From < FI >,
494
497
{
495
498
/// Field width
496
499
pub const WIDTH : u8 = 1 ;
@@ -504,7 +507,7 @@ macro_rules! impl_bit_proxy {
504
507
where
505
508
REG : Writable + RegisterSpec <Ux = U >,
506
509
U : RawReg ,
507
- FI : Into < bool >,
510
+ bool : From < FI >,
508
511
{
509
512
/// Writes bit to the field
510
513
#[ inline( always) ]
@@ -516,7 +519,7 @@ macro_rules! impl_bit_proxy {
516
519
/// Writes `variant` to the field
517
520
#[ inline( always) ]
518
521
pub fn variant( self , variant: FI ) -> & ' a mut REG :: Writer {
519
- self . bit( variant . into ( ) )
522
+ self . bit( bool :: from ( variant ) )
520
523
}
521
524
}
522
525
} ;
@@ -534,7 +537,7 @@ impl<'a, U, REG, N, FI, const WI: u8, const OF: u8> FieldWriter<'a, U, REG, N, F
534
537
where
535
538
REG : Writable + RegisterSpec < Ux = U > ,
536
539
U : RawReg + From < N > ,
537
- FI : Into < N > ,
540
+ N : From < FI > ,
538
541
{
539
542
/// Writes raw bits to the field
540
543
///
@@ -550,14 +553,14 @@ where
550
553
/// Writes `variant` to the field
551
554
#[ inline( always) ]
552
555
pub fn variant ( self , variant : FI ) -> & ' a mut REG :: Writer {
553
- unsafe { self . bits ( variant . into ( ) ) }
556
+ unsafe { self . bits ( N :: from ( variant ) ) }
554
557
}
555
558
}
556
559
impl < ' a , U , REG , N , FI , const WI : u8 , const OF : u8 > FieldWriterSafe < ' a , U , REG , N , FI , WI , OF >
557
560
where
558
561
REG : Writable + RegisterSpec < Ux = U > ,
559
562
U : RawReg + From < N > ,
560
- FI : Into < N > ,
563
+ N : From < FI > ,
561
564
{
562
565
/// Writes raw bits to the field
563
566
#[ inline( always) ]
@@ -569,7 +572,7 @@ where
569
572
/// Writes `variant` to the field
570
573
#[ inline( always) ]
571
574
pub fn variant ( self , variant : FI ) -> & ' a mut REG :: Writer {
572
- self . bits ( variant . into ( ) )
575
+ self . bits ( N :: from ( variant ) )
573
576
}
574
577
}
575
578
@@ -585,7 +588,7 @@ impl<'a, U, REG, FI, const OF: u8> BitWriter<'a, U, REG, FI, OF>
585
588
where
586
589
REG : Writable + RegisterSpec < Ux = U > ,
587
590
U : RawReg ,
588
- FI : Into < bool > ,
591
+ bool : From < FI > ,
589
592
{
590
593
/// Sets the field bit
591
594
#[ inline( always) ]
@@ -603,7 +606,7 @@ impl<'a, U, REG, FI, const OF: u8> BitWriter1S<'a, U, REG, FI, OF>
603
606
where
604
607
REG : Writable + RegisterSpec < Ux = U > ,
605
608
U : RawReg ,
606
- FI : Into < bool > ,
609
+ bool : From < FI > ,
607
610
{
608
611
/// Sets the field bit
609
612
#[ inline( always) ]
@@ -616,7 +619,7 @@ impl<'a, U, REG, FI, const OF: u8> BitWriter0C<'a, U, REG, FI, OF>
616
619
where
617
620
REG : Writable + RegisterSpec < Ux = U > ,
618
621
U : RawReg ,
619
- FI : Into < bool > ,
622
+ bool : From < FI > ,
620
623
{
621
624
/// Clears the field bit
622
625
#[ inline( always) ]
@@ -629,7 +632,7 @@ impl<'a, U, REG, FI, const OF: u8> BitWriter1C<'a, U, REG, FI, OF>
629
632
where
630
633
REG : Writable + RegisterSpec < Ux = U > ,
631
634
U : RawReg ,
632
- FI : Into < bool > ,
635
+ bool : From < FI > ,
633
636
{
634
637
///Clears the field bit by passing one
635
638
#[ inline( always) ]
@@ -642,7 +645,7 @@ impl<'a, U, REG, FI, const OF: u8> BitWriter0S<'a, U, REG, FI, OF>
642
645
where
643
646
REG : Writable + RegisterSpec < Ux = U > ,
644
647
U : RawReg ,
645
- FI : Into < bool > ,
648
+ bool : From < FI > ,
646
649
{
647
650
///Sets the field bit by passing zero
648
651
#[ inline( always) ]
@@ -655,7 +658,7 @@ impl<'a, U, REG, FI, const OF: u8> BitWriter1T<'a, U, REG, FI, OF>
655
658
where
656
659
REG : Writable + RegisterSpec < Ux = U > ,
657
660
U : RawReg ,
658
- FI : Into < bool > ,
661
+ bool : From < FI > ,
659
662
{
660
663
///Toggle the field bit by passing one
661
664
#[ inline( always) ]
@@ -668,7 +671,7 @@ impl<'a, U, REG, FI, const OF: u8> BitWriter0T<'a, U, REG, FI, OF>
668
671
where
669
672
REG : Writable + RegisterSpec < Ux = U > ,
670
673
U : RawReg ,
671
- FI : Into < bool > ,
674
+ bool : From < FI > ,
672
675
{
673
676
///Toggle the field bit by passing zero
674
677
#[ inline( always) ]
0 commit comments