Skip to content

Commit c276ce0

Browse files
committed
Moved expression body method
1 parent 300461e commit c276ce0

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/Helper.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -254,19 +254,6 @@ public static T[] Call<T>(this T[] items, Action<T, int> action)
254254
return items;
255255
}
256256

257-
/// <summary>
258-
/// Invokes a method of <typeparamref name="TInput"/> to <typeparamref name="TOutput"/> and then returns the argument provided.
259-
/// </summary>
260-
/// <remarks>
261-
/// This can be used to intercept current variables or calculations by for example, printing the value as it is being passed as an argument.
262-
/// </remarks>
263-
/// <typeparam name="TInput">The type of <paramref name="item"/>.</typeparam>
264-
/// <typeparam name="TOutput">The type to return.</typeparam>
265-
/// <param name="item">The item to use as reference and modify.</param>
266-
/// <param name="func">The function to apply <paramref name="item"/> to.</param>
267-
/// <returns>The item <paramref name="item"/> after <paramref name="func"/>.</returns>
268-
public static TOutput Mutate<TInput, TOutput>(this TInput item, Func<TInput, TOutput> func) => func(item);
269-
270257
/// <summary>
271258
/// Returns the element of an array, pretending that the array wraps around or is circular.
272259
/// </summary>
@@ -768,6 +755,19 @@ public static IEnumerable<T> Slice<T>(this IEnumerable<T> source, int start, int
768755
/// <returns><paramref name="t"/></returns>
769756
public static T NullCheck<T>(this T t, string message = "While asserting for null, the variable ended up null.", bool isIterator = false) => t is not null ? t : throw (isIterator ? new NullIteratorException(message) : throw new NullReferenceException(message));
770757

758+
/// <summary>
759+
/// Invokes a method of <typeparamref name="TInput"/> to <typeparamref name="TOutput"/> and then returns the argument provided.
760+
/// </summary>
761+
/// <remarks>
762+
/// This can be used to intercept current variables or calculations by for example, printing the value as it is being passed as an argument.
763+
/// </remarks>
764+
/// <typeparam name="TInput">The type of <paramref name="item"/>.</typeparam>
765+
/// <typeparam name="TOutput">The type to return.</typeparam>
766+
/// <param name="item">The item to use as reference and modify.</param>
767+
/// <param name="func">The function to apply <paramref name="item"/> to.</param>
768+
/// <returns>The item <paramref name="item"/> after <paramref name="func"/>.</returns>
769+
public static TOutput Mutate<TInput, TOutput>(this TInput item, Func<TInput, TOutput> func) => func(item);
770+
771771
/// <summary>
772772
/// Appends the element provided to the array.
773773
/// </summary>

0 commit comments

Comments
 (0)