@@ -352,13 +352,13 @@ pub fn clamp<T, U> (input: &Array, arg1: &T, arg2: &U, batch: bool) -> Array
352352}
353353
354354macro_rules! arith_scalar_func {
355- ( $rust_type: ty, $op_name: ident, $fn_name: ident, $ffi_fn : ident ) => (
355+ ( $rust_type: ty, $op_name: ident, $fn_name: ident) => (
356356 impl <' f> $op_name<$rust_type> for & ' f Array {
357357 type Output = Array ;
358358
359359 fn $fn_name( self , rhs: $rust_type) -> Array {
360360 let temp = rhs. clone( ) ;
361- add ( self , & temp, false )
361+ $fn_name ( self , & temp, false )
362362 }
363363 }
364364
@@ -367,18 +367,18 @@ macro_rules! arith_scalar_func {
367367
368368 fn $fn_name( self , rhs: $rust_type) -> Array {
369369 let temp = rhs. clone( ) ;
370- add ( & self , & temp, false )
370+ $fn_name ( & self , & temp, false )
371371 }
372372 }
373373 )
374374}
375375
376376macro_rules! arith_scalar_spec {
377377 ( $ty_name: ty) => (
378- arith_scalar_func!( $ty_name, Add , add, af_add ) ;
379- arith_scalar_func!( $ty_name, Sub , sub, af_sub ) ;
380- arith_scalar_func!( $ty_name, Mul , mul, af_mul ) ;
381- arith_scalar_func!( $ty_name, Div , div, af_div ) ;
378+ arith_scalar_func!( $ty_name, Add , add) ;
379+ arith_scalar_func!( $ty_name, Sub , sub) ;
380+ arith_scalar_func!( $ty_name, Mul , mul) ;
381+ arith_scalar_func!( $ty_name, Div , div) ;
382382 )
383383}
384384
@@ -393,51 +393,51 @@ arith_scalar_spec!(i32);
393393arith_scalar_spec ! ( u8 ) ;
394394
395395macro_rules! arith_func {
396- ( $op_name: ident, $fn_name: ident) => (
396+ ( $op_name: ident, $fn_name: ident, $delegate : ident ) => (
397397 impl $op_name<Array > for Array {
398398 type Output = Array ;
399399
400400 fn $fn_name( self , rhs: Array ) -> Array {
401- add ( & self , & rhs, false )
401+ $delegate ( & self , & rhs, false )
402402 }
403403 }
404404
405405 impl <' a> $op_name<& ' a Array > for Array {
406406 type Output = Array ;
407407
408408 fn $fn_name( self , rhs: & ' a Array ) -> Array {
409- add ( & self , rhs, false )
409+ $delegate ( & self , rhs, false )
410410 }
411411 }
412412
413413 impl <' a> $op_name<Array > for & ' a Array {
414414 type Output = Array ;
415415
416416 fn $fn_name( self , rhs: Array ) -> Array {
417- add ( self , & rhs, false )
417+ $delegate ( self , & rhs, false )
418418 }
419419 }
420420
421421 impl <' a, ' b> $op_name<& ' a Array > for & ' b Array {
422422 type Output = Array ;
423423
424424 fn $fn_name( self , rhs: & ' a Array ) -> Array {
425- add ( self , rhs, false )
425+ $delegate ( self , rhs, false )
426426 }
427427 }
428428 )
429429}
430430
431- arith_func ! ( Add , add ) ;
432- arith_func ! ( Sub , sub ) ;
433- arith_func ! ( Mul , mul ) ;
434- arith_func ! ( Div , div ) ;
435- arith_func ! ( Rem , rem ) ;
436- arith_func ! ( BitAnd , bitand ) ;
437- arith_func ! ( BitOr , bitor ) ;
438- arith_func ! ( BitXor , bitxor ) ;
439- arith_func ! ( Shl , shl ) ;
440- arith_func ! ( Shr , shr ) ;
431+ arith_func ! ( Add , add , add ) ;
432+ arith_func ! ( Sub , sub , sub ) ;
433+ arith_func ! ( Mul , mul , mul ) ;
434+ arith_func ! ( Div , div , div ) ;
435+ arith_func ! ( Rem , rem , rem ) ;
436+ arith_func ! ( Shl , shl , shiftl ) ;
437+ arith_func ! ( Shr , shr , shiftr ) ;
438+ arith_func ! ( BitAnd , bitand , bitand ) ;
439+ arith_func ! ( BitOr , bitor , bitor ) ;
440+ arith_func ! ( BitXor , bitxor , bitxor ) ;
441441
442442#[ cfg( op_assign) ]
443443mod op_assign {
0 commit comments