Render consecutive twitter embeds as on

Closes #695
This commit is contained in:
Oleksii Holub
2022-06-30 20:56:44 +03:00
parent 057902f919
commit 23e1850d15
8 changed files with 155 additions and 39 deletions

View File

@@ -0,0 +1,18 @@
using System.Collections.Generic;
namespace DiscordChatExporter.Core.Utils.Extensions;
public static class CollectionExtensions
{
public static IEnumerable<T> Enumerate<T>(this T obj)
{
yield return obj;
}
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++);
}
}