Consistency

This commit is contained in:
Tyrrrz
2023-04-14 21:04:21 +03:00
parent 36db99b5cf
commit 505330e117
2 changed files with 2 additions and 2 deletions

View File

@@ -70,7 +70,7 @@ public partial record Embed
// with this by merging related embeds at the end of the message parsing process.
// https://github.com/Tyrrrz/DiscordChatExporter/issues/695
var images =
json.GetPropertyOrNull("image")?.Pipe(EmbedImage.Parse).Enumerate().ToArray() ??
json.GetPropertyOrNull("image")?.Pipe(EmbedImage.Parse).ToSingletonEnumerable().ToArray() ??
Array.Empty<EmbedImage>();
var video = json.GetPropertyOrNull("video")?.Pipe(EmbedVideo.Parse);

View File

@@ -4,7 +4,7 @@ namespace DiscordChatExporter.Core.Utils.Extensions;
public static class CollectionExtensions
{
public static IEnumerable<T> Enumerate<T>(this T obj)
public static IEnumerable<T> ToSingletonEnumerable<T>(this T obj)
{
yield return obj;
}