@@ -371,13 +371,9 @@ mod tests {
371
371
372
372
lua. set ( "v" , & orig[ ..] ) ;
373
373
374
- let read: Vec < _ > = lua. get ( "v" ) . unwrap ( ) ;
374
+ let read: Vec < f64 > = lua. get ( "v" ) . unwrap ( ) ;
375
375
for ( o, r) in orig. iter ( ) . zip ( read. iter ( ) ) {
376
- if let AnyLuaValue :: LuaNumber ( ref n) = * r {
377
- assert_eq ! ( o, n) ;
378
- } else {
379
- panic ! ( "Unexpected variant" ) ;
380
- }
376
+ assert_eq ! ( * o, * r) ;
381
377
}
382
378
}
383
379
@@ -387,7 +383,7 @@ mod tests {
387
383
388
384
lua. execute :: < ( ) > ( r#"v = { [-1] = -1, [2] = 2, [42] = 42 }"# ) . unwrap ( ) ;
389
385
390
- let read: Option < Vec < _ > > = lua. get ( "v" ) ;
386
+ let read: Option < Vec < AnyLuaValue > > = lua. get ( "v" ) ;
391
387
if read. is_some ( ) {
392
388
panic ! ( "Unexpected success" ) ;
393
389
}
@@ -399,7 +395,7 @@ mod tests {
399
395
400
396
lua. execute :: < ( ) > ( r#"v = { }"# ) . unwrap ( ) ;
401
397
402
- let read: Vec < _ > = lua. get ( "v" ) . unwrap ( ) ;
398
+ let read: Vec < f64 > = lua. get ( "v" ) . unwrap ( ) ;
403
399
assert_eq ! ( read. len( ) , 0 ) ;
404
400
}
405
401
@@ -409,7 +405,7 @@ mod tests {
409
405
410
406
lua. execute :: < ( ) > ( r#"v = { [-1] = -1, ["foo"] = 2, [{}] = 42 }"# ) . unwrap ( ) ;
411
407
412
- let read: Option < Vec < _ > > = lua. get ( "v" ) ;
408
+ let read: Option < Vec < AnyLuaValue > > = lua. get ( "v" ) ;
413
409
if read. is_some ( ) {
414
410
panic ! ( "Unexpected success" ) ;
415
411
}
@@ -429,7 +425,7 @@ mod tests {
429
425
430
426
lua. set ( "v" , & orig[ ..] ) ;
431
427
432
- let read: Vec < _ > = lua. get ( "v" ) . unwrap ( ) ;
428
+ let read: Vec < AnyLuaValue > = lua. get ( "v" ) . unwrap ( ) ;
433
429
assert_eq ! ( read, orig) ;
434
430
}
435
431
@@ -439,11 +435,11 @@ mod tests {
439
435
440
436
lua. execute :: < ( ) > ( r#"v = { 1, 2, 3 }"# ) . unwrap ( ) ;
441
437
442
- let read: Vec < _ > = lua. get ( "v" ) . unwrap ( ) ;
438
+ let read: Vec < AnyLuaValue > = lua. get ( "v" ) . unwrap ( ) ;
443
439
assert_eq ! (
444
440
read,
445
441
[ 1. , 2. , 3. ] . iter( )
446
- . map( |x| AnyLuaValue :: LuaNumber ( * x) ) . collect:: <Vec <_ >>( ) ) ;
442
+ . map( |x| AnyLuaValue :: LuaNumber ( * x) ) . collect:: <Vec <AnyLuaValue >>( ) ) ;
447
443
}
448
444
449
445
#[ test]
0 commit comments