@@ -473,99 +473,99 @@ impl Value {
473
473
pub ( crate ) fn generic_bin_into < T , E > (
474
474
self ,
475
475
other : Self ,
476
- n : impl FnOnce ( Array < f64 > , Array < f64 > ) -> Result < T , E > ,
477
- _b : impl FnOnce ( Array < u8 > , Array < u8 > ) -> Result < T , E > ,
478
- _co : impl FnOnce ( Array < Complex > , Array < Complex > ) -> Result < T , E > ,
479
- ch : impl FnOnce ( Array < char > , Array < char > ) -> Result < T , E > ,
480
- f : impl FnOnce ( Array < Boxed > , Array < Boxed > ) -> Result < T , E > ,
476
+ num : impl FnOnce ( Array < f64 > , Array < f64 > ) -> Result < T , E > ,
477
+ byte : impl FnOnce ( Array < u8 > , Array < u8 > ) -> Result < T , E > ,
478
+ comp : impl FnOnce ( Array < Complex > , Array < Complex > ) -> Result < T , E > ,
479
+ char : impl FnOnce ( Array < char > , Array < char > ) -> Result < T , E > ,
480
+ bx : impl FnOnce ( Array < Boxed > , Array < Boxed > ) -> Result < T , E > ,
481
481
err : impl FnOnce ( Self , Self ) -> E ,
482
482
) -> Result < T , E > {
483
483
match ( self , other) {
484
- ( Self :: Num ( a) , Self :: Num ( b) ) => n ( a, b) ,
485
- ( Self :: Byte ( a) , Self :: Byte ( b) ) => _b ( a, b) ,
486
- ( Self :: Byte ( a) , Self :: Num ( b) ) => n ( a. convert ( ) , b) ,
487
- ( Self :: Num ( a) , Self :: Byte ( b) ) => n ( a, b. convert ( ) ) ,
488
- ( Self :: Complex ( a) , Self :: Complex ( b) ) => _co ( a, b) ,
489
- ( Self :: Complex ( a) , Self :: Num ( b) ) => _co ( a, b. convert ( ) ) ,
490
- ( Self :: Num ( a) , Self :: Complex ( b) ) => _co ( a. convert ( ) , b) ,
491
- ( Self :: Complex ( a) , Self :: Byte ( b) ) => _co ( a, b. convert ( ) ) ,
492
- ( Self :: Byte ( a) , Self :: Complex ( b) ) => _co ( a. convert ( ) , b) ,
493
- ( Self :: Char ( a) , Self :: Char ( b) ) => ch ( a, b) ,
494
- ( Self :: Box ( a) , Self :: Box ( b) ) => f ( a, b) ,
495
- ( Self :: Box ( a) , b) => f ( a, b. coerce_to_boxes ( ) ) ,
496
- ( a, Self :: Box ( b) ) => f ( a. coerce_to_boxes ( ) , b) ,
484
+ ( Self :: Num ( a) , Self :: Num ( b) ) => num ( a, b) ,
485
+ ( Self :: Byte ( a) , Self :: Byte ( b) ) => byte ( a, b) ,
486
+ ( Self :: Byte ( a) , Self :: Num ( b) ) => num ( a. convert ( ) , b) ,
487
+ ( Self :: Num ( a) , Self :: Byte ( b) ) => num ( a, b. convert ( ) ) ,
488
+ ( Self :: Complex ( a) , Self :: Complex ( b) ) => comp ( a, b) ,
489
+ ( Self :: Complex ( a) , Self :: Num ( b) ) => comp ( a, b. convert ( ) ) ,
490
+ ( Self :: Num ( a) , Self :: Complex ( b) ) => comp ( a. convert ( ) , b) ,
491
+ ( Self :: Complex ( a) , Self :: Byte ( b) ) => comp ( a, b. convert ( ) ) ,
492
+ ( Self :: Byte ( a) , Self :: Complex ( b) ) => comp ( a. convert ( ) , b) ,
493
+ ( Self :: Char ( a) , Self :: Char ( b) ) => char ( a, b) ,
494
+ ( Self :: Box ( a) , Self :: Box ( b) ) => bx ( a, b) ,
495
+ ( Self :: Box ( a) , b) => bx ( a, b. coerce_to_boxes ( ) ) ,
496
+ ( a, Self :: Box ( b) ) => bx ( a. coerce_to_boxes ( ) , b) ,
497
497
( a, b) => Err ( err ( a, b) ) ,
498
498
}
499
499
}
500
500
#[ allow( clippy:: too_many_arguments) ]
501
501
pub ( crate ) fn generic_bin_ref < T , E > (
502
502
& self ,
503
503
other : & Self ,
504
- n : impl FnOnce ( & Array < f64 > , & Array < f64 > ) -> Result < T , E > ,
505
- _b : impl FnOnce ( & Array < u8 > , & Array < u8 > ) -> Result < T , E > ,
506
- _co : impl FnOnce ( & Array < Complex > , & Array < Complex > ) -> Result < T , E > ,
507
- ch : impl FnOnce ( & Array < char > , & Array < char > ) -> Result < T , E > ,
508
- f : impl FnOnce ( & Array < Boxed > , & Array < Boxed > ) -> Result < T , E > ,
504
+ num : impl FnOnce ( & Array < f64 > , & Array < f64 > ) -> Result < T , E > ,
505
+ byte : impl FnOnce ( & Array < u8 > , & Array < u8 > ) -> Result < T , E > ,
506
+ comp : impl FnOnce ( & Array < Complex > , & Array < Complex > ) -> Result < T , E > ,
507
+ char : impl FnOnce ( & Array < char > , & Array < char > ) -> Result < T , E > ,
508
+ bx : impl FnOnce ( & Array < Boxed > , & Array < Boxed > ) -> Result < T , E > ,
509
509
err : impl FnOnce ( & Self , & Self ) -> E ,
510
510
) -> Result < T , E > {
511
511
match ( self , other) {
512
- ( Self :: Num ( a) , Self :: Num ( b) ) => n ( a, b) ,
513
- ( Self :: Byte ( a) , Self :: Byte ( b) ) => _b ( a, b) ,
514
- ( Self :: Byte ( a) , Self :: Num ( b) ) => n ( & a. convert_ref ( ) , b) ,
515
- ( Self :: Num ( a) , Self :: Byte ( b) ) => n ( a, & b. convert_ref ( ) ) ,
516
- ( Self :: Complex ( a) , Self :: Complex ( b) ) => _co ( a, b) ,
517
- ( Self :: Complex ( a) , Self :: Num ( b) ) => _co ( a, & b. convert_ref ( ) ) ,
518
- ( Self :: Num ( a) , Self :: Complex ( b) ) => _co ( & a. convert_ref ( ) , b) ,
519
- ( Self :: Complex ( a) , Self :: Byte ( b) ) => _co ( a, & b. convert_ref ( ) ) ,
520
- ( Self :: Byte ( a) , Self :: Complex ( b) ) => _co ( & a. convert_ref ( ) , b) ,
521
- ( Self :: Char ( a) , Self :: Char ( b) ) => ch ( a, b) ,
522
- ( Self :: Box ( a) , Self :: Box ( b) ) => f ( a, b) ,
523
- ( Self :: Box ( a) , b) => f ( a, & b. coerce_as_boxes ( ) ) ,
524
- ( a, Self :: Box ( b) ) => f ( & a. coerce_as_boxes ( ) , b) ,
512
+ ( Self :: Num ( a) , Self :: Num ( b) ) => num ( a, b) ,
513
+ ( Self :: Byte ( a) , Self :: Byte ( b) ) => byte ( a, b) ,
514
+ ( Self :: Byte ( a) , Self :: Num ( b) ) => num ( & a. convert_ref ( ) , b) ,
515
+ ( Self :: Num ( a) , Self :: Byte ( b) ) => num ( a, & b. convert_ref ( ) ) ,
516
+ ( Self :: Complex ( a) , Self :: Complex ( b) ) => comp ( a, b) ,
517
+ ( Self :: Complex ( a) , Self :: Num ( b) ) => comp ( a, & b. convert_ref ( ) ) ,
518
+ ( Self :: Num ( a) , Self :: Complex ( b) ) => comp ( & a. convert_ref ( ) , b) ,
519
+ ( Self :: Complex ( a) , Self :: Byte ( b) ) => comp ( a, & b. convert_ref ( ) ) ,
520
+ ( Self :: Byte ( a) , Self :: Complex ( b) ) => comp ( & a. convert_ref ( ) , b) ,
521
+ ( Self :: Char ( a) , Self :: Char ( b) ) => char ( a, b) ,
522
+ ( Self :: Box ( a) , Self :: Box ( b) ) => bx ( a, b) ,
523
+ ( Self :: Box ( a) , b) => bx ( a, & b. coerce_as_boxes ( ) ) ,
524
+ ( a, Self :: Box ( b) ) => bx ( & a. coerce_as_boxes ( ) , b) ,
525
525
( a, b) => Err ( err ( a, b) ) ,
526
526
}
527
527
}
528
528
#[ allow( clippy:: too_many_arguments) ]
529
529
pub ( crate ) fn generic_bin_mut < T , E > (
530
530
& mut self ,
531
531
other : Self ,
532
- n : impl FnOnce ( & mut Array < f64 > , Array < f64 > ) -> Result < T , E > ,
533
- _b : impl FnOnce ( & mut Array < u8 > , Array < u8 > ) -> Result < T , E > ,
534
- _co : impl FnOnce ( & mut Array < Complex > , Array < Complex > ) -> Result < T , E > ,
535
- ch : impl FnOnce ( & mut Array < char > , Array < char > ) -> Result < T , E > ,
536
- f : impl FnOnce ( & mut Array < Boxed > , Array < Boxed > ) -> Result < T , E > ,
532
+ num : impl FnOnce ( & mut Array < f64 > , Array < f64 > ) -> Result < T , E > ,
533
+ byte : impl FnOnce ( & mut Array < u8 > , Array < u8 > ) -> Result < T , E > ,
534
+ comp : impl FnOnce ( & mut Array < Complex > , Array < Complex > ) -> Result < T , E > ,
535
+ char : impl FnOnce ( & mut Array < char > , Array < char > ) -> Result < T , E > ,
536
+ bx : impl FnOnce ( & mut Array < Boxed > , Array < Boxed > ) -> Result < T , E > ,
537
537
err : impl FnOnce ( & Self , & Self ) -> E ,
538
538
) -> Result < T , E > {
539
539
match ( & mut * self , other) {
540
- ( Self :: Num ( a) , Self :: Num ( b) ) => n ( a, b) ,
541
- ( Self :: Byte ( a) , Self :: Byte ( b) ) => _b ( a, b) ,
540
+ ( Self :: Num ( a) , Self :: Num ( b) ) => num ( a, b) ,
541
+ ( Self :: Byte ( a) , Self :: Byte ( b) ) => byte ( a, b) ,
542
542
( Self :: Byte ( a) , Self :: Num ( b) ) => {
543
543
let mut a_num = a. convert_ref ( ) ;
544
- let res = n ( & mut a_num, b) ;
544
+ let res = num ( & mut a_num, b) ;
545
545
* self = a_num. into ( ) ;
546
546
res
547
547
}
548
- ( Self :: Num ( a) , Self :: Byte ( b) ) => n ( a, b. convert_ref ( ) ) ,
549
- ( Self :: Complex ( a) , Self :: Complex ( b) ) => _co ( a, b) ,
550
- ( Self :: Complex ( a) , Self :: Num ( b) ) => _co ( a, b. convert_ref ( ) ) ,
548
+ ( Self :: Num ( a) , Self :: Byte ( b) ) => num ( a, b. convert_ref ( ) ) ,
549
+ ( Self :: Complex ( a) , Self :: Complex ( b) ) => comp ( a, b) ,
550
+ ( Self :: Complex ( a) , Self :: Num ( b) ) => comp ( a, b. convert_ref ( ) ) ,
551
551
( Self :: Num ( a) , Self :: Complex ( b) ) => {
552
552
let mut a_comp = a. convert_ref ( ) ;
553
- let res = _co ( & mut a_comp, b) ;
553
+ let res = comp ( & mut a_comp, b) ;
554
554
* self = a_comp. into ( ) ;
555
555
res
556
556
}
557
- ( Self :: Complex ( a) , Self :: Byte ( b) ) => _co ( a, b. convert_ref ( ) ) ,
557
+ ( Self :: Complex ( a) , Self :: Byte ( b) ) => comp ( a, b. convert_ref ( ) ) ,
558
558
( Self :: Byte ( a) , Self :: Complex ( b) ) => {
559
559
let mut a_comp = a. convert_ref ( ) ;
560
- let res = _co ( & mut a_comp, b) ;
560
+ let res = comp ( & mut a_comp, b) ;
561
561
* self = a_comp. into ( ) ;
562
562
res
563
563
}
564
- ( Self :: Char ( a) , Self :: Char ( b) ) => ch ( a, b) ,
565
- ( Self :: Box ( a) , b) => f ( a, b. coerce_to_boxes ( ) ) ,
564
+ ( Self :: Char ( a) , Self :: Char ( b) ) => char ( a, b) ,
565
+ ( Self :: Box ( a) , b) => bx ( a, b. coerce_to_boxes ( ) ) ,
566
566
( a, Self :: Box ( b) ) => {
567
567
let mut a_box = take ( a) . coerce_to_boxes ( ) ;
568
- let res = f ( & mut a_box, b) ;
568
+ let res = bx ( & mut a_box, b) ;
569
569
* self = a_box. into ( ) ;
570
570
res
571
571
}
0 commit comments