Skip to content

Commit 85c525c

Browse files
leandromohatifaziz
authored andcommitted
Use var in XML doc examples for less type ceremony
1 parent 6de4121 commit 85c525c

File tree

8 files changed

+14
-16
lines changed

8 files changed

+14
-16
lines changed

MoreLinq/Generate.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ static partial class MoreEnumerable
3636
/// </remarks>
3737
/// <example>
3838
/// <code><![CDATA[
39-
/// IEnumerable<int> result = MoreEnumerable.Generate(2, n => n * n).Take(5);
39+
/// var result = MoreEnumerable.Generate(2, n => n * n).Take(5);
4040
/// ]]></code>
4141
/// The <c>result</c> variable, when iterated over, will yield 2, 4, 16, 256, and 65536, in turn.
4242
/// </example>

MoreLinq/Pad.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static partial class MoreEnumerable
4040
/// <example>
4141
/// <code><![CDATA[
4242
/// int[] numbers = { 123, 456, 789 };
43-
/// IEnumerable<int> result = numbers.Pad(5);
43+
/// var result = numbers.Pad(5);
4444
/// ]]></code>
4545
/// The <c>result</c> variable, when iterated over, will yield
4646
/// 123, 456, 789 and two zeroes, in turn.
@@ -69,7 +69,7 @@ public static IEnumerable<TSource> Pad<TSource>(this IEnumerable<TSource> source
6969
/// <example>
7070
/// <code><![CDATA[
7171
/// int[] numbers = { 123, 456, 789 };
72-
/// IEnumerable<int> result = numbers.Pad(5, -1);
72+
/// var result = numbers.Pad(5, -1);
7373
/// ]]></code>
7474
/// The <c>result</c> variable, when iterated over, will yield
7575
/// 123, 456, and 789 followed by two occurrences of -1, in turn.
@@ -100,7 +100,7 @@ public static IEnumerable<TSource> Pad<TSource>(this IEnumerable<TSource> source
100100
/// <example>
101101
/// <code><![CDATA[
102102
/// int[] numbers = { 0, 1, 2 };
103-
/// IEnumerable<int> result = numbers.Pad(5, i => -i);
103+
/// var result = numbers.Pad(5, i => -i);
104104
/// ]]></code>
105105
/// The <c>result</c> variable, when iterated over, will yield
106106
/// 0, 1, 2, -3 and -4, in turn.

MoreLinq/Pairwise.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ static partial class MoreEnumerable
4242
/// <example>
4343
/// <code><![CDATA[
4444
/// int[] numbers = { 123, 456, 789 };
45-
/// IEnumerable<int> result = numbers.Pairwise((a, b) => a + b);
45+
/// var result = numbers.Pairwise((a, b) => a + b);
4646
/// ]]></code>
4747
/// The <c>result</c> variable, when iterated over, will yield
4848
/// 579 and 1245, in turn.

MoreLinq/PreScan.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,10 @@ static partial class MoreEnumerable
3636
/// </remarks>
3737
/// <example>
3838
/// <code><![CDATA[
39-
/// Func<int, int, int> plus = (a, b) => a + b;
4039
/// int[] values = { 1, 2, 3, 4 };
41-
/// IEnumerable<int> prescan = values.PreScan(plus, 0);
42-
/// IEnumerable<int> scan = values.Scan(plus; a + b);
43-
/// IEnumerable<int> result = values.ZipShortest(prescan, plus);
40+
/// var prescan = values.PreScan((a, b) => a + b, 0);
41+
/// var scan = values.Scan((a, b) => a + b);
42+
/// var result = values.ZipShortest(prescan, plus);
4443
/// ]]></code>
4544
/// <c>prescan</c> will yield <c>{ 0, 1, 3, 6 }</c>, while <c>scan</c>
4645
/// and <c>result</c> will both yield <c>{ 1, 3, 6, 10 }</c>. This

MoreLinq/Prepend.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ static partial class MoreEnumerable
3636
/// </remarks>
3737
/// <code><![CDATA[
3838
/// int[] numbers = { 1, 2, 3 };
39-
/// IEnumerable<int> result = numbers.Prepend(0);
39+
/// var result = numbers.Prepend(0);
4040
/// ]]></code>
4141
/// The <c>result</c> variable, when iterated over, will yield
4242
/// 0, 1, 2 and 3, in turn.

MoreLinq/Scan.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,10 @@ static partial class MoreEnumerable
3636
/// </remarks>
3737
/// <example>
3838
/// <code><![CDATA[
39-
/// Func<int, int, int> plus = (a, b) => a + b;
4039
/// int[] values = { 1, 2, 3, 4 };
41-
/// IEnumerable<int> prescan = values.PreScan(plus, 0);
42-
/// IEnumerable<int> scan = values.Scan(plus; a + b);
43-
/// IEnumerable<int> result = values.ZipShortest(prescan, plus);
40+
/// var prescan = values.PreScan((a, b) => a + b, 0);
41+
/// var scan = values.Scan((a, b) => a + b);
42+
/// var result = values.ZipShortest(prescan, plus);
4443
/// ]]></code>
4544
/// <c>prescan</c> will yield <c>{ 0, 1, 3, 6 }</c>, while <c>scan</c>
4645
/// and <c>result</c> will both yield <c>{ 1, 3, 6, 10 }</c>. This

MoreLinq/TakeEvery.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ static partial class MoreEnumerable
3838
/// <example>
3939
/// <code><![CDATA[
4040
/// int[] numbers = { 1, 2, 3, 4, 5 };
41-
/// IEnumerable<int> result = numbers.TakeEvery(2);
41+
/// var result = numbers.TakeEvery(2);
4242
/// ]]></code>
4343
/// The <c>result</c> variable, when iterated over, will yield 1, 3 and 5, in turn.
4444
/// </example>

MoreLinq/TakeLast.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ static partial class MoreEnumerable
3939
/// <example>
4040
/// <code><![CDATA[
4141
/// int[] numbers = { 12, 34, 56, 78 };
42-
/// IEnumerable<int> result = numbers.TakeLast(2);
42+
/// var result = numbers.TakeLast(2);
4343
/// ]]></code>
4444
/// The <c>result</c> variable, when iterated over, will yield
4545
/// 56 and 78 in turn.

0 commit comments

Comments
 (0)