@@ -13,6 +13,7 @@ public void ShouldReturnLastElement()
1313 Enumerable . Range ( 0 , 10 )
1414 . ToArray ( )
1515 . ToRefStructEnumerable ( )
16+ . Where ( ( in int x ) => true )
1617 . TryLast ( ref last )
1718 . Should ( )
1819 . BeTrue ( ) ;
@@ -26,7 +27,8 @@ public void ShouldReturnLastElementZeroAlloc()
2627 var array = Enumerable . Range ( 0 , 10 )
2728 . ToArray ( )
2829 . ToRefStructEnumerable ( )
29- . TryLast ( ref last , x=> x )
30+ . Where ( ( in int x ) => true )
31+ . TryLast ( ref last , x => x )
3032 . Should ( )
3133 . BeTrue ( ) ;
3234 last . Should ( ) . Be ( 9 ) ;
@@ -39,6 +41,7 @@ public void ShouldThrowException()
3941 StructEnumerable . Empty < int > ( )
4042 . ToArray ( )
4143 . ToRefStructEnumerable ( )
44+ . Where ( ( in int x ) => true )
4245 . TryLast ( ref last )
4346 . Should ( )
4447 . BeFalse ( ) ;
@@ -51,7 +54,8 @@ public void ShouldThrowExceptionZeroAlloc()
5154 StructEnumerable . Empty < int > ( )
5255 . ToArray ( )
5356 . ToRefStructEnumerable ( )
54- . TryLast ( ref last , x=> x )
57+ . Where ( ( in int x ) => true )
58+ . TryLast ( ref last , x => x )
5559 . Should ( )
5660 . BeFalse ( ) ;
5761 }
@@ -64,7 +68,8 @@ public void ShouldReturnLastElementWithFunc()
6468 Enumerable . Range ( 0 , 10 )
6569 . ToArray ( )
6670 . ToRefStructEnumerable ( )
67- . TryLast ( x=> x > 5 , ref last )
71+ . Where ( ( in int x ) => true )
72+ . TryLast ( x => x > 5 , ref last )
6873 . Should ( )
6974 . BeTrue ( ) ;
7075 last . Should ( ) . Be ( 9 ) ;
@@ -77,10 +82,12 @@ public void ShouldReturnLastElementWithFuncZeroAlloc()
7782 Enumerable . Range ( 0 , 10 )
7883 . ToArray ( )
7984 . ToRefStructEnumerable ( )
80- . TryLast ( x => x > 5 , ref last , x=> x )
85+ . Where ( ( in int x ) => true )
86+ . TryLast ( x => x > 5 , ref last , x => x )
8187 . Should ( )
8288 . BeTrue ( ) ;
8389 last . Should ( ) . Be ( 9 ) ;
8490 }
8591 }
92+
8693}
0 commit comments