mirror of
https://github.com/Tyrrrz/CliFx.git
synced 2025-10-25 15:19:17 +00:00
Clean up
This commit is contained in:
@@ -3,6 +3,7 @@ using System.IO;
|
|||||||
using CliFx.Exceptions;
|
using CliFx.Exceptions;
|
||||||
using CliFx.Infrastructure;
|
using CliFx.Infrastructure;
|
||||||
using CliFx.Utils;
|
using CliFx.Utils;
|
||||||
|
using CliFx.Utils.Extensions;
|
||||||
|
|
||||||
namespace CliFx.Formatting;
|
namespace CliFx.Formatting;
|
||||||
|
|
||||||
@@ -26,10 +27,8 @@ internal class ExceptionConsoleFormatter : ConsoleFormatter
|
|||||||
|
|
||||||
Write('(');
|
Write('(');
|
||||||
|
|
||||||
for (var i = 0; i < stackFrame.Parameters.Count; i++)
|
foreach (var (parameter, i) in stackFrame.Parameters.WithIndex())
|
||||||
{
|
{
|
||||||
var parameter = stackFrame.Parameters[i];
|
|
||||||
|
|
||||||
// Separator
|
// Separator
|
||||||
if (i > 0)
|
if (i > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,6 +7,13 @@ namespace CliFx.Utils.Extensions;
|
|||||||
|
|
||||||
internal static class CollectionExtensions
|
internal static class CollectionExtensions
|
||||||
{
|
{
|
||||||
|
public static IEnumerable<(T value, int index)> WithIndex<T>(this IEnumerable<T> source)
|
||||||
|
{
|
||||||
|
var i = 0;
|
||||||
|
foreach (var o in source)
|
||||||
|
yield return (o, i++);
|
||||||
|
}
|
||||||
|
|
||||||
public static IEnumerable<T> WhereNotNull<T>(this IEnumerable<T?> source)
|
public static IEnumerable<T> WhereNotNull<T>(this IEnumerable<T?> source)
|
||||||
where T : class
|
where T : class
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user