@@ -467,7 +467,7 @@ mod tests {
467467 ] ) ) as ArrayRef ;
468468
469469 // generated with Murmur3Hash(Seq(Literal(1L)), 42).eval() since Spark is tested
470- let hashes = create_murmur3_hashes ( 5 , & [ i . clone ( ) ] , 42 ) ;
470+ let hashes = create_murmur3_hashes ( 5 , std :: slice :: from_ref ( & i ) , 42 ) ;
471471 let expected: Vec < i32 > = [
472472 0x99f0149d_u32 ,
473473 0x9c67b85d ,
@@ -482,7 +482,7 @@ mod tests {
482482
483483 // generated with XxHash64(Seq(Literal(1L)), 42).eval() since Spark is tested
484484 // against this as well
485- let hashes = create_xxhash64_hashes ( 5 , & [ i . clone ( ) ] , 42 ) ;
485+ let hashes = create_xxhash64_hashes ( 5 , std :: slice :: from_ref ( & i ) , 42 ) ;
486486 let expected = vec ! [
487487 -7001672635703045582 ,
488488 -5252525462095825812 ,
@@ -495,11 +495,11 @@ mod tests {
495495
496496 #[ test]
497497 fn test_str ( ) {
498- let i = Arc :: new ( StringArray :: from ( vec ! [ "hello" , "bar" , "" , "😁" , "天地" ] ) ) ;
498+ let i = Arc :: new ( StringArray :: from ( vec ! [ "hello" , "bar" , "" , "😁" , "天地" ] ) ) as ArrayRef ;
499499
500500 // generated with Murmur3Hash(Seq(Literal("")), 42).eval() since Spark is tested
501501 // against this as well
502- let hashes = create_murmur3_hashes ( 5 , & [ i . clone ( ) ] , 42 ) ;
502+ let hashes = create_murmur3_hashes ( 5 , std :: slice :: from_ref ( & i ) , 42 ) ;
503503 let expected: Vec < i32 > = [ 3286402344_u32 , 2486176763 , 142593372 , 885025535 , 2395000894 ]
504504 . into_iter ( )
505505 . map ( |v| v as i32 )
@@ -508,7 +508,7 @@ mod tests {
508508
509509 // generated with XxHash64(Seq(Literal("")), 42).eval() since Spark is tested
510510 // against this as well
511- let hashes = create_xxhash64_hashes ( 5 , & [ i . clone ( ) ] , 42 ) ;
511+ let hashes = create_xxhash64_hashes ( 5 , std :: slice :: from_ref ( & i ) , 42 ) ;
512512 let expected = vec ! [
513513 -4367754540140381902 ,
514514 -1798770879548125814 ,
@@ -541,7 +541,7 @@ mod tests {
541541 let array_ref = Arc :: new ( list_array) as ArrayRef ;
542542
543543 // Test Murmur3 hash
544- let hashes = create_murmur3_hashes ( 3 , & [ array_ref. clone ( ) ] , 42 ) ;
544+ let hashes = create_murmur3_hashes ( 3 , std :: slice :: from_ref ( & array_ref) , 42 ) ;
545545 assert_eq ! ( hashes, vec![ -222940379 , -374492525 , -331964951 ] ) ;
546546 Ok ( ( ) )
547547 }
0 commit comments